Another PostgreSQL/PHP error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Love_Daddy
Forum Commoner
Posts: 61
Joined: Wed Jul 10, 2002 6:55 am
Location: South Africa
Contact:

Another PostgreSQL/PHP error

Post by Love_Daddy »

Hi again,

I've found another error::

No route to host Is the server running on host localhost and accepting TCP/IP connections
on port 5432 in /var/www/html/test.php on line
Connection Failed.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Is the server running? Try this in a shell -> netstat -l
This will list all listening progs and the ports they are listening on.

Later on,
BDKR
User avatar
haagen
Forum Commoner
Posts: 79
Joined: Thu Jul 11, 2002 3:57 pm
Location: Sweden, Lund

Post by haagen »

If I'm not remebering wrong php connects through the tcp port (the error message idicates it too). Check your ph_hba.conf file, in debain i resides in /etc/postgres.

This file controles who and how who should be allowed to access the server. Check so there is a line looking like this:

Code: Select all

host         all         127.0.0.1     255.255.255.255   trust
This means that everyone (with a psql account) can connect from localhost.

Hope this helps!
Post Reply