X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 49F9C9DC9A5 for ; Wed, 11 Jan 2006 14:02:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30184-06 for ; Wed, 11 Jan 2006 14:01:59 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 963799DC98E for ; Wed, 11 Jan 2006 14:01:57 -0400 (AST) Received: from hotmail.com (bay13-f14.bay13.hotmail.com [64.4.31.14]) by svr4.postgresql.org (Postfix) with ESMTP id F26265AF031 for ; Wed, 11 Jan 2006 18:01:57 +0000 (GMT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 11 Jan 2006 10:01:50 -0800 Message-ID: Received: from 129.215.170.72 by by13fd.bay13.hotmail.msn.com with HTTP; Wed, 11 Jan 2006 18:01:49 GMT X-Originating-IP: [129.215.170.72] X-Originating-Email: [bahhab@hotmail.com] X-Sender: bahhab@hotmail.com From: "John Coulthard" To: pgsql-php@postgresql.org Subject: conection problem after upgrade to php5 and postgres 8.0.3 Date: Wed, 11 Jan 2006 18:01:49 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 11 Jan 2006 18:01:50.0236 (UTC) FILETIME=[188EBDC0:01C616D9] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.919 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44, MSGID_FROM_MTA_HEADER=0] X-Spam-Score: 1.919 X-Spam-Level: * X-Archive-Number: 200601/23 X-Sequence-Number: 3394 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() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user "webuser" 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 !
" ; 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/