From 0ccda81dd73d6fd5fa15bbf5b00be390599f1089 Mon Sep 17 00:00:00 2001 From: Frank John Begornia Date: Fri, 2 Jan 2026 02:00:30 +0800 Subject: [PATCH] Fix database connection to use TCP port instead of Unix socket --- send_report.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/send_report.php b/send_report.php index 7814fa8..73b912c 100644 --- a/send_report.php +++ b/send_report.php @@ -14,6 +14,7 @@ $config = [ 'crew' => [ 'db_name' => getenv('DB_NAME_CREW') ?: 'custom_design', 'db_host' => getenv('DB_HOST_CREW') ?: getenv('DB_HOST') ?: 'mysql', + 'db_port' => getenv('DB_PORT_CREW') ?: '3306', 'db_user' => getenv('DB_USER_CREW') ?: 'crew_user', 'db_pass' => getenv('DB_PASS_CREW') ?: getenv('DB_PASS'), 'smtp_user' => 'mail@crewsportswear.com', @@ -30,6 +31,7 @@ $config = [ 'merchbay' => [ 'db_name' => getenv('DB_NAME_MERCHBAY') ?: 'merchbay_laravel', 'db_host' => getenv('DB_HOST_MERCHBAY') ?: getenv('DB_HOST') ?: 'mysql', + 'db_port' => getenv('DB_PORT_MERCHBAY') ?: '3306', 'db_user' => getenv('DB_USER_MERCHBAY') ?: 'merchbay_user', 'db_pass' => getenv('DB_PASS_MERCHBAY') ?: getenv('DB_PASS'), 'smtp_user' => 'support@merchbay.com', @@ -50,7 +52,7 @@ $cfg = $config[$brand]; // Connect to brand-specific database try { $conn = new PDO( - "mysql:host={$cfg['db_host']};dbname={$cfg['db_name']}", + "mysql:host={$cfg['db_host']};port={$cfg['db_port']};dbname={$cfg['db_name']}", $cfg['db_user'], $cfg['db_pass'] );