php can't connect to postgresql server - Mailing list pgsql-general

From Clodoaldo Pinto
Subject php can't connect to postgresql server
Date
Msg-id a595de7a0607030625o63876d74n35bad5236de6c0fe@mail.gmail.com
Whole thread Raw
Responses Re: php can't connect to postgresql server  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: php can't connect to postgresql server  (Robert Treat <xzilla@users.sourceforge.net>)
Re: php can't connect to postgresql server  ("Clodoaldo Pinto" <clodoaldo.pinto@gmail.com>)
List pgsql-general
php can't connect to postgresql server

php error log message:

PHP Warning:  pg_connect() [<a
href='function.pg-connect'>function.pg-connect</a>]: Unable to connect
to PostgreSQL server: could not connect to server: Permission
denied\n\tIs the server running on host "127.0.0.1" and
accepting\n\tTCP/IP connections on port 5432?

php connection string:

$conn_string = "hostaddr=127.0.0.1 port=5432 dbname=dbname
user=username password=password";

Also tried host=localhost

pg_hba:

host dbname       username  127.0.0.1/32 md5

I can connect as that user with psql:

$ psql -h localhost -U username dbname
Password for user username:
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.

This same setup works in another server running 8.0. Differences:

old server | new server
FC3 | FC5
php 4.3.11 | php 5.1.4
httpd 2.0 | httpd 2.2

What else should I check? I am out of ideas.

Regards, Clodoaldo Pinto

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Optimizing query: select ... where id = 4 and md5(...) = '...'
Next
From: Joost Kraaijeveld
Date:
Subject: Re: Is what I want possible and if so how?