Skip site navigation (1) Skip section navigation (2)

Re: problem with connection to remote server

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Ireneusz(dot)Tarnowski(at)pwr(dot)wroc(dot)pl
Cc: Andrew McMillan <andrew(at)morphoss(dot)com>, pgsql-php(at)postgresql(dot)org
Subject: Re: problem with connection to remote server
Date: 2010-01-28 13:46:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-php
In response to Ireneusz Tarnowski <Ireneusz(dot)Tarnowski(at)pwr(dot)wroc(dot)pl>:

> > In addition to this, PHP will give some pretty useful error messages when
> > it can't connect.  If you're not seeing those, then you should adjust
> > your application logic to log them, it will make your life a lot easier.
> > If they don't clearly define the problem, post them here ... I (and
> > others like me) have seen them enough to know what they indicate.
> I have warning:
> Warning: pg_connect() []: Unable to connect to PostgreSQL server: could not connect to server: No such file or directory Is the server running on host "XX.XX.XX.XX" and accepting TCP/IP connections on port 5432? in /export/sun1000/XXXXXXX/public_html/dbtest.php on line 10
> And nothing more. Postgresql log, apache error log and php error log write nothing  about this connection.

This is usually the result of a network problem.  hba problems are usually
reported as such by PHP.  I would first 2x check the obvious ... did you
mistype the IP or hostname in the connection string?  Check firewall logs
to ensure it's not being blocked by something.  Run tcpdump on the server
to see if it's getting the syn packets.

Bill Moran

In response to

pgsql-php by date

Next:From: Gustavo Amarilla SantacruzDate: 2010-01-28 23:40:48
Subject: Re: Undefined function pg_connect()
Previous:From: Bill MoranDate: 2010-01-28 13:44:15
Subject: Re: Undefined function pg_connect()

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group