cancel
Showing results for 
Search instead for 
Did you mean: 

PostgreSQL error

Russell.Wood
Frequent Advisor

PostgreSQL error

Hi All,

When I try to connect to a PostgreSQL database running locally using PHP I get the following error:

"Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: could not get socket error status: No such file or directory in <script>"

The error that appears in the postgresql log is:

"LOG: incomplete startup packet"

I can connect to the database using pgAdmin III.

I have tried to connect to the database locally and via TCP/IP. I can connect locally using psql command.

Any advise is appreciated.
5 REPLIES
Mel Burslan
Honored Contributor

Re: PostgreSQL error

Not a postgres expert here but are you sure your networking information is correct ? Is your database listener running and listening to the port your PHP application is trying to access to ?
________________________________
UNIX because I majored in cryptology...
Russell.Wood
Frequent Advisor

Re: PostgreSQL error

Yes. As I said, I can connect to it from my PC using pgAdmin (and telnet) plus I can connect locally with psql (like sqlplus for the Oracle folk). It's only when PHP connects it gets the strange error.
Eric Antunes
Honored Contributor

Re: PostgreSQL error

Hi Russell,

Check this forum:

http://forums.devshed.com/postgresql-help-21/pg-connect-unable-to-connect-to-postgresql-server-48639.html

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Russell.Wood
Frequent Advisor

Re: PostgreSQL error

Like I said. I'm able to connect to it via TCP/IP and locally.
Marcel S. Gongora
Occasional Visitor

Re: PostgreSQL error

Hello Russell.Wood,
I have exactly the same problem and after trying many solutions, I came to the conclusion that the problem is the PHP module for postgre.
I hosted my website on another server with Debian and everything seems to work. In this test the web application connects to the POSTGRE on HP-UX.
I tested with the PHP of the HP-UX Apache-based Web Server version B.2.2.8.04 and B.2.0.59.02.
I trying with POSTGRE 8.1.17 compiled by myself, 8.2.5 and 8.3.7 both binary from iexpress DVD.
Who else can I do to solve this problem??