By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Can't connect to postgresql server

P: n/a
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 &quot;127.0.0.1&quot; 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
pgsql 8.0 | pgsql 8.1

I have another server (FC5 / 5.1.4 / 2.2 / 8.1) in which it works.

The same script running from another server (FC3 / 4.3.11/ 2.0) can
connect to the new
server using this pg_hba entry:
host dbname usename xx.xx.xxx.xx/32 md5

It just can't connect locally which is not postgres a problem since I
can connect locally with that user with psql.

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

More details:
http://archives.postgresql.org/pgsql...7/msg00068.php

Regards, Clodoaldo Pinto

Jul 3 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.