mirror of
https://github.com/nihonbuzz/nihonbuzz-academy.git
synced 2026-01-26 05:25:37 +07:00
27 lines
1.1 KiB
PHP
27 lines
1.1 KiB
PHP
<?php
|
|
echo "<h3>PHP Debug Info</h3>";
|
|
echo "<strong>PHP Version:</strong> " . phpversion() . "<br>";
|
|
echo "<strong>Loaded INI File:</strong> " . php_ini_loaded_file() . "<br>";
|
|
echo "<strong>Active PDO Drivers:</strong> " . implode(', ', pdo_drivers()) . "<br>";
|
|
|
|
echo "<hr>";
|
|
echo "<h3>Connection Test</h3>";
|
|
|
|
try {
|
|
// Attempt standard connection
|
|
$dsn = "pgsql:host=10.10.30.3;port=5432;dbname=nihonbuzz_academy";
|
|
$user = "nihonbuzz_user";
|
|
$pass = "password_to_be_changed"; // Using the default we set earlier
|
|
|
|
$pdo = new PDO($dsn, $user, $pass);
|
|
echo "<span style='color:green; font-weight:bold;'>✅ Connection SUCCESS!</span><br>";
|
|
echo "Connected to PostgreSQL database successfully.";
|
|
} catch (PDOException $e) {
|
|
echo "<span style='color:red; font-weight:bold;'>❌ Connection FAILED</span><br>";
|
|
echo "Error Message: " . $e->getMessage() . "<br>";
|
|
|
|
if (strpos($e->getMessage(), 'could not find driver') !== false) {
|
|
echo "<br><strong>Troubleshooting:</strong> The PostgreSQL driver is missing. Verify php.ini settings and restart the web server.";
|
|
}
|
|
}
|