Thread: Connect PostgreSQL 6.0 Server with php4b

Connect PostgreSQL 6.0 Server with php4b

From
Matthias Teege
Date:
Moin,

i have an PostgreSQL 6.0 Server wich I would query with php4b. I have
problems to make the connection because off php gives me the following
error message:

Warning: Unable to connect to PostgresSQL server: Failed to
authenticate client as Postgres user 'nobody' using authentication
scheme 131072. in /usr/local/share/apache/htdocs/matthias/hellodb.php
on line 2
An error occured.

Were is the Problem?

Many thanks
Matthias

Re: [GENERAL] Connect PostgreSQL 6.0 Server with php4b

From
Charles Tassell
Date:
Your problem is probably in the /usr/local/pgsql/data/pg_hba.conf file.
That file lists what machines are allowed to connect to your Postgres
server and what sort of authentication they have to provide.  If the web
server and the Postgres server are on the same machine, you should have
these two lines  in that file:
local        all    trust
host         all         127.0.0.1        255.255.255.255   trust

If they are on seperate machines, you will want to set up something like:
host         all         web.server.ip   255.255.255.255   crypt

and set up accounts/passwords for your PHP scripts, then use this sort of
thing to connect to the DB:
$dbCon = pg_PConnect("host=postgres.server.address user=username
password=password dbname=database.to.connect.to");


At 06:45 AM 10/9/99, Matthias Teege wrote:
>Moin,
>
>i have an PostgreSQL 6.0 Server wich I would query with php4b. I have
>problems to make the connection because off php gives me the following
>error message:
>
>Warning: Unable to connect to PostgresSQL server: Failed to
>authenticate client as Postgres user 'nobody' using authentication
>scheme 131072. in /usr/local/share/apache/htdocs/matthias/hellodb.php
>on line 2
>An error occured.
>
>Were is the Problem?
>
>Many thanks
>Matthias
>
>************
>


Re: [GENERAL] Connect PostgreSQL 6.0 Server with php4b

From
Matthias Teege
Date:
Moin,

thank you for your reply but the problem remain. The fallowing line is
in my pg_hba.conf:

host         moon        192.168.153.0 255.255.255.0     trust

The hole network with the given number has access to the database moon.
The Webserver has the IP 192.168.153.9. But the no connection is
possible. I've tried an explicit line in pg_hba.conf for the webserver
but without any success.

Any other hints? :-)

Thanks
Matthias


On Sun, Oct 10, 1999 at 04:51:24PM -0300, Charles Tassell wrote:
> Your problem is probably in the /usr/local/pgsql/data/pg_hba.conf file.
> That file lists what machines are allowed to connect to your Postgres
> server and what sort of authentication they have to provide.  If the web
> server and the Postgres server are on the same machine, you should have
> these two lines  in that file:
> local        all    trust
> host         all         127.0.0.1        255.255.255.255   trust
>
> If they are on seperate machines, you will want to set up something like:
> host         all         web.server.ip   255.255.255.255   crypt
>
> and set up accounts/passwords for your PHP scripts, then use this sort of
> thing to connect to the DB:
> $dbCon = pg_PConnect("host=postgres.server.address user=username
> password=password dbname=database.to.connect.to");
>
>
> At 06:45 AM 10/9/99, Matthias Teege wrote:
> >Moin,
> >
> >i have an PostgreSQL 6.0 Server wich I would query with php4b. I have
> >problems to make the connection because off php gives me the following
> >error message:
> >
> >Warning: Unable to connect to PostgresSQL server: Failed to
> >authenticate client as Postgres user 'nobody' using authentication
> >scheme 131072. in /usr/local/share/apache/htdocs/matthias/hellodb.php
> >on line 2
> >An error occured.
> >
> >Were is the Problem?
> >
> >Many thanks
> >Matthias
> >
> >************
> >
>
>

--
Matthias Teege -- matthias@mteege.de -- http://emugs.de
make world not war
PGP-Key auf Anfrage