I am trying to develop a basic page that uses PostgreSQL for the database. The database is already set. Right now I was simply trying to create a connection with it.
<?php
echo "test 1";
$dbconn = pg_connect("host='localhost' port='5432' dbname='demorole' user='demorole' password='eta'") or die ("couldnt connect");
echo "test 2";
?>
demorole
is my database and its owner user. eta
is a sample of password (but is correct)
My problem is that this page doesn't work at all. It doesn't display any errors. When i use the function pg_connection_status()
it doesn't return anything. It only prints "test 1" (the echo
commands are for debugging purposes).
I am working on Linux Mint. Both PostgreSQL and Apache are running. The connection info are correct. Any idea what might be wrong? Because, since it doesn't display any errors, I'm stuck.