RES: php can't connect to postgresql server

From: "Alejandro Michelin Salomon \( Adinet \)" <alejmsg(at)adinet(dot)com(dot)uy>
To: "'Clodoaldo Pinto'" <clodoaldo(dot)pinto(at)gmail(dot)com>
Cc: "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: RES: php can't connect to postgresql server
Date: 2006-07-03 22:04:28
Message-ID: !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAhx491Ki2tUS42D/aMPFg1MKAAAAQAAAAgi3j2pHQ9EC0ko4x9cAHzQEAAAAA@adinet.com.uy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Clodoaldo Pinto worte:

-->-----Mensagem original-----
-->De: pgsql-general-owner(at)postgresql(dot)org
-->[mailto:pgsql-general-owner(at)postgresql(dot)org] Em nome de
-->Clodoaldo Pinto
-->Enviada em: segunda-feira, 3 de julho de 2006 12:13
-->Para: pgsql-general postgresql.org
-->Assunto: Re: [GENERAL] php can't connect to postgresql server
-->
-->
-->2006/7/3, Clodoaldo Pinto <clodoaldo(dot)pinto(at)gmail(dot)com>:
-->> 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 &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
-->>
-->> What else should I check? I am out of ideas.
-->
-->The same script running from another server can connect to
-->the new server using this pg_hba entry:
-->host dbname usename xx.xx.xxx.xx/32 md5
-->
-->Clodoaldo

postgresql.conf -->

listen_addresses = '*' ---- >This is any ip.

pg_hba.conf -->

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# IPv4 local connections:
host all all 127.0.0.1/32 md5

This is the configuration that i choose when install postgresql in windows
xp.

Try this.

Alejandro Michelin Salomon
Porto Alegre
Brasil

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tatsuo Ishii 2006-07-04 01:10:55 Re: High-Availability Question
Previous Message Alexander Farber 2006-07-03 19:14:22 Re: Optimizing query: select ... where id = 4 and md5(...) = '...'