hardcoded port and hostname matching name of docker setup

This commit is contained in:
luptmoor
2026-04-19 12:26:03 +02:00
parent c249c8e049
commit 250ca9909d
2 changed files with 10 additions and 3 deletions

View File

@@ -16,8 +16,8 @@ if (file_exists($envFile)) {
}
// Defines Environment Variables
$host = getenv('POSTGRES_HOST');
$port = getenv('POSTGRES_PORT');
$host = getenv('POSTGRES_HOSTNAME');
$port = 5432;
$db = getenv('POSTGRES_DB');
$user = getenv('POSTGRES_USER');
$pass = getenv('POSTGRES_PASSWORD');
@@ -35,6 +35,13 @@ try {
];
$dsn = "pgsql:host=$host;dbname=$db;port=$port";
$pdo = new PDO($dsn, $user, $pass, $opt);
$pdo = new PDO($dsn, $user, $pass, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
// Creates Error Message
} catch(PDOException $e) {