pgconnect.php
<?php
$db_connection = pg_connect("host=localhost dbname=postgres user=postgres password=postgres");
if ($db_connection) {
echo 'Connection attempt succeeded.';
} else {
echo 'Connection attempt failed.';
}
?>
这是我的pgconnect.php页面。我收到内部服务器500错误。我无法弄清楚这段代码的问题。如果有人可以帮助我,那就太好了。
您可以添加一些代码来显示错误(如果有):
$db_connection = pg_connect("
host=localhost
dbname=postgres
user=postgres
password=postgres
") or die('Could not connect:' . pg_last_error());