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

pg_connect problem

From: "Edric Bulalacao" <egb(at)tonesoft(dot)com>
To: <pgsql-php(at)postgresql(dot)org>
Subject: pg_connect problem
Date: 2003-09-03 17:36:14
Message-ID: HJENIMPAKDMENODLAJNMMEEKCFAA.egb@tonesoft.com (view raw or flat)
Thread:
Lists: pgsql-php
I’m a PHP/PostGRE newbie.  I’m getting this error:

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not
connect to server: Connection refused Is the server running on host
localhost and accepting TCP/IP connections on port 5432? . in
/export/home/tsc/a/delete-action.phtml on line 156
Couldn't make a connection!

This is the code I’m trying to run:
$connection = pg_connect("host=localhost dbname=address user=address
password=address");

This is my pg_hba.conf
local  all      all             password

This is the output of “netstat –an | grep 5432”
unix  2      [ ACC ]     STREAM     LISTENING     27649  /tmp/.s.PGSQL.5432

I’m able to do “psql –u address” and supply and username and password as any
Unix user defined in the system.


Can anyone tell me what I’m doing wrong?  Thanks.

Responses

pgsql-php by date

Next:From: nzegarraDate: 2003-09-03 18:00:21
Subject: Re: pg_connect problem
Previous:From: CoLDate: 2003-09-02 21:35:51
Subject: Re: Strange browser behavior when querying PostgreSql database

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