Re: [Phplib-users] unable to connect to pgsql server
Brought to you by:
nhruby,
richardarcher
From: Clark F. <cl...@th...> - 2004-05-24 20:20:22
|
Frank, I think this may be because PHP is attempting to connect to Postgres via an IP socket (even though they are on the same host) and Postgres is only accepting Unix socket connections, or vice-versa. In your local4.inc, try putting var $Host = ""; instead of "localhost" in the connection config for your database class and see if that works. I use Postgres and that's what I do and it works for me. I remember reading something about this in the Postgres docs but I don't recall exactly how it works. I think if you configure Postgres to accept IP connections, putting "localhost" for your $Host will work. Hope that helps. Clark On Sun, 23 May 2004, Frank Bax wrote: > I am currently running phplib 7.4 on OpenBSD 2.9 / PHP 4.0.4pl1 / pgsql 7.1 > I have created a new system on OpenBSD 3.5 / PHP 4.3.5RC3 / pgsql 7.3.5 > I start pgsql with: > su -l _pgsql -c "/usr/local/bin/pg_ctl start \ > -D /var/pgsql/data -l /var/pgsql/logfile.`date +\%Y\%m\%d` \ > -o '-i -B 512 -D /var/pgsql/data'" > I copied an existing database and php application to the new box for > testing, but when I try to access the application webpage, I get the > following message in apache error log: > PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: unknown > host name: localhost in /php/class/phplib-7.4/db_pgsql.inc on line 51 > > I'm not sure what step I might have missed during setup of the new system. > > Frank |