Page 1 of 1

PostgreSQL connection Fails

Posted: Mon Jul 22, 2002 5:18 am
by Love_Daddy
Hi All,

I'm battling to connect to my Database using the ff method::

<?
$user="romeom";
$dbname="employees";

$conn=pg_connect("user=$user dbname=$dbname");
if (!$conn) {
echo "No Connection";
} else {
echo "Connection Established";
}
?>

When I run in konsole using php <filename.php> it says Connection Established,
But in http://localhost/test.php, it does not establish the connection.
The error message is:
Unable to connect to Postgresql server:FATAL 1: IDENT authentication failed for user "romeom" in
<b>/var/www/html/test.php</b> on line 4
Connection Failed.

What am I doing wrong?undefinedundefined

Posted: Tue Jul 23, 2002 2:35 pm
by 9902468
Postgre allows connections from your computer, but not from host localhost. Edit your something_hba.conf file.