I have a postgres database on 2 different linux servers. the PHP application code resides on one of the servers. I am trying to use pg_connect like this:
****
$conn = pg_connect ("hostaddr=$InServer port=5432 dbname=sag0s01 user=$InUser password=$InPassword"
****
where I pass in the tcpip address of the database server I want to connect to into InServer and the user and password in the other parameters.
When I am connecting to the database on the server where the php code exists, it works fine, but when I try to access the database on the other server I get the following message:
****
Warning: Unable to connect to PostgreSQL server: connectDBStart() -- connect() failed: Connection refused Is the postmaster running (with -i) at 'localhost' and accepting connections on TCP/IP port 5432? in /var/ on line 11
Any help is much appreciated........... Laura
****
$conn = pg_connect ("hostaddr=$InServer port=5432 dbname=sag0s01 user=$InUser password=$InPassword"
****
where I pass in the tcpip address of the database server I want to connect to into InServer and the user and password in the other parameters.
When I am connecting to the database on the server where the php code exists, it works fine, but when I try to access the database on the other server I get the following message:
****
Warning: Unable to connect to PostgreSQL server: connectDBStart() -- connect() failed: Connection refused Is the postmaster running (with -i) at 'localhost' and accepting connections on TCP/IP port 5432? in /var/ on line 11
Any help is much appreciated........... Laura