conection problem after upgrade to php5 and postgres 8.0.3

From: "John Coulthard" <bahhab(at)hotmail(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: conection problem after upgrade to php5 and postgres 8.0.3
Date: 2006-01-11 18:01:49
Message-ID: BAY13-F14567063DFFCCD64E5310CCF240@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi,

I've had to rebuild our web server and now my php scripts will not connect
to postgres can anyone tell me why?

Thanks for any help, details below.
Annie

I was using Redhat9, postgres 7.3.4, php 4.2.2 and apache2
now using Fedora core 4, postgres 8.0.3, php 5.0.4 and apache2

I know php is configured for psql
http://zeldia.cap.ed.ac.uk/Lumbribase/php_info.php

In postgrsql.conf I tried changing listen_addresses = 'localhost' to
listen_addresses = '*' but that didn't work.

I think the pg_hba.conf is OK..
# "local" is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all ***.*.*.*/** ident sameuser
# IPv6 local connections:
host all all ::*/*** ident sameuser

The error in /var/log/http/error_log is...
[client ***.***.***.***] PHP Warning: pg_connect() [<a
href='function.pg-connect'>function.pg-connect</a>]: Unable to connect to
PostgreSQL server: FATAL: Ident authentication failed for user
&quot;webuser&quot; in /var/www/html/Lumbribase/pg_name.php on line 17,
referer: http://zeldia.cap.ed.ac.uk/Lumbribase/search_id.php

and a typical php connection script is...
$PG_HOST="localhost";
$PG_PORT=5432;
$PG_DATABASE="lumbribase";
$PG_USER="webuser";
$PG_PASS="";
$PI=pi();

$dbconn=pg_connect( "dbname=$PG_DATABASE host=$PG_HOST port=$PG_PORT
user=$PG_USER password=$PG_PASS" );
if ( ! $dbconn ) {
echo "Error connecting to the database !<br> " ;
printf("%s", pg_errormessage( $dbconn ) );
exit();
}

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Patrick White 2006-01-11 18:08:27 Fwd: Having tough time getting php working for postgresql..
Previous Message Janning Vygen 2006-01-11 18:00:25 Re: Having tough time getting php working for postgresql..