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 B95739DC874 for ; Wed, 11 Jan 2006 14:20:15 -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 34355-05 for ; Wed, 11 Jan 2006 14:20:11 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.195]) by postgresql.org (Postfix) with ESMTP id A9DD59DC802 for ; Wed, 11 Jan 2006 14:20:09 -0400 (AST) Received: by xproxy.gmail.com with SMTP id s14so151231wxc for ; Wed, 11 Jan 2006 10:20:10 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LYFdpBgjUgruOnxy6Q4dTQpe+X628tUSfIZyOExVkEMW6798M+dTgGJmd1LL3VDuQPIVTmp5sdkHKnbTrt7nhMafhpGIPZzM+B6Fs7yXK+uz+hLa2dfCrwecBNhHHKv5VfVcSpovoSUelwEYMOBztdHivaZktEtqNiPLdPGZFLA= Received: by 10.70.82.7 with SMTP id f7mr1141582wxb; Wed, 11 Jan 2006 10:20:09 -0800 (PST) Received: by 10.70.48.13 with HTTP; Wed, 11 Jan 2006 10:20:09 -0800 (PST) Message-ID: <9e0a28690601111020k757ce970g16636a47e0f7dd9e@mail.gmail.com> Date: Wed, 11 Jan 2006 14:20:09 -0400 From: Juan Miguel Paredes To: John Coulthard Subject: Re: conection problem after upgrade to php5 and postgres 8.0.3 Cc: pgsql-php@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200601/26 X-Sequence-Number: 3397 Hi, John! > 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 Note that the above configuration will use 'ident sameuser' authentication for connections via tcp/ip (like the one you're trying from your webserver). So, your connection will need an OS account (and no password supplied). That's what your error_log is telling you, and I'm guessing that the account you're supplying for the connection is not an OS account, but a Postgres account. If you want to use Postgres account authentication (e.g. users created via CREATE USER in Postgres DB), perhaps you should try md5 authentication in your pg_hba.conf. More details in http://www.postgresql.org/docs/8.0/interactive/client-authentication.html Regards. > > The error in /var/log/http/error_log is... > [client ***.***.***.***] PHP Warning: pg_connect() [ href=3D'function.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=3D"localhost"; > $PG_PORT=3D5432; > $PG_DATABASE=3D"lumbribase"; > $PG_USER=3D"webuser"; > $PG_PASS=3D""; > $PI=3Dpi(); > > $dbconn=3Dpg_connect( "dbname=3D$PG_DATABASE host=3D$PG_HOST port=3D$PG_P= ORT > user=3D$PG_USER password=3D$PG_PASS" ); > if ( ! $dbconn ) { > echo "Error connecting to the database !
" ; > printf("%s", pg_errormessage( $dbconn ) ); > exit(); > } >