PHP and PostgreSQL 9.0, pg_connect fails to connect - Mailing list pgsql-general

From Thomas Harold
Subject PHP and PostgreSQL 9.0, pg_connect fails to connect
Date
Msg-id 4DB81734.8050202@nybeta.com
Whole thread Raw
Responses Re: PHP and PostgreSQL 9.0, pg_connect fails to connect
List pgsql-general
I'm having trouble figuring out where this one is going wrong.  It's a
brand new install of PostgreSQL 9.0 from PGDG on a RHEL5 box, running
Apache 2.2 and PHP 5.3 (from IUS).

- PostgreSQL 9.0 is running and listening on the localhost.  I can run
pgAdmin III and connect to it over a SSH port-forward to the loopback.

- nmap reports that pgsql is alive and listening on localhost:5432.

- I can use the psql command to connect to the localhost and am able to
login as the username/password that I'm using in the pg_connect() call.
  I can connect to the target database.  I can create tables in the
database/schema using that username (so pgsql roles don't seem to be the
issue).

- SELinux is running, but there are no denied messages in
/var/log/audit/audit.log and no setroubleshooting alerts in
/var/log/messages either.

- The firewall doesn't seem to be the issue (due to the nmap query).

- I've tried forcing IPv4 by specifying the database server as 127.0.0.1
instead of localhost.

- No errors in the Apache logs either.

- The server came with PHP 5.1.6 and I've tried out an early version of
PHP 5.3, then upgraded to 5.3.6.

All I'm getting back from pg_connect() is "Connect: failed to connect to
database.".

Is there a specific minimum version of the php-pgsql add-on that is
needed in order to talk to a pgsql 9.0 database?  Am I going to need to
compile PHP from source (using the pgsql 9.0 developer packages)?


pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Create Database automatacally after silent installation of postgresql. ?
Next
From: Merlin Moncure
Date:
Subject: Re: Best way to construct PostgreSQL ArrayType (_int4) from C int array