pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Juan Miguel Paredes <juan.paredes@gmail.com>
To: John Coulthard <bahhab@hotmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: conection problem after upgrade to php5 and postgres 8.0.3
Date: Wed, 11 Jan 2006 14:20:09 -0400
Message-ID: <9e0a28690601111020k757ce970g16636a47e0f7dd9e@mail.gmail.com> (raw)
In-Reply-To: <BAY13-F14567063DFFCCD64E5310CCF240@phx.gbl>
References: <BAY13-F14567063DFFCCD64E5310CCF240@phx.gbl>

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() [<a
> href='function.pg-connect'>function.pg-connect</a>]: 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 !<br> " ;
>     printf("%s", pg_errormessage( $dbconn ) );
>     exit();
> }
>



view thread (3+ messages)  latest in thread

Message-ID: <9e0a28690601111020k757ce970g16636a47e0f7dd9e@mail.gmail.com>
Permalink:  ../9e0a28690601111020k757ce970g16636a47e0f7dd9e@mail.gmail.com/
Also on:    postgresql.org/message-id/9e0a28690601111020k757ce970g16636a47e0f7dd9e@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: juan.paredes@gmail.com, bahhab@hotmail.com
  Subject: Re: conection problem after upgrade to php5 and postgres 8.0.3
  In-Reply-To: <9e0a28690601111020k757ce970g16636a47e0f7dd9e@mail.gmail.com>
  References: <BAY13-F14567063DFFCCD64E5310CCF240@phx.gbl> <9e0a28690601111020k757ce970g16636a47e0f7dd9e@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox