From: Frank Bax <fbax@sympatico.ca>
To: pgsql-php@postgresql.org
Subject: Re: unable to connect to pgsql server
Date: Wed, 26 May 2004 09:50:06 -0400
Message-ID: <5.2.1.1.0.20040526091656.02306cb0@pop6.sympatico.ca> (raw)
In-Reply-To: <BCD8D846.112B7%hierophant@pcisys.net>
References: <5.2.1.1.0.20040524141824.02d7b060@pop6.sympatico.ca>
At 01:02 PM 5/25/04, Keary Suska wrote:
>on 5/24/04 2:59 PM, fbax@sympatico.ca purportedly said:
>
> > I couldn't figure out OpenBSD options for netstat. Do these prove the same
> > thing?
> > # netstat -l | grep 5432
> > 0xd187f7d8 stream 0 0 0xe8844498 0x0 0x0 0x0
> > /tmp/.s.PGSQL.5432
>
>You could probably do this:
># netstat -ln | grep 5432
>
>Which should show two entries--one for TCP/IP, one for Unix Domain Socket.
# netstat -ln | grep 5432
tcp 0 0 192.168.1.90.29958 192.168.1.90.5432 TIME_WAIT
0xd187f7d8 stream 0 0 0xe8844498 0x0 0x0 0x0
/tmp/.s.PGSQL.5432
> > # fstat | head -n 1 ; fstat | grep 5432
> > USER CMD PID FD MOUNT INUM MODE R/W DV|SZ
> > _pgsql postgres 5444 3* internet stream tcp 0xd18729dc *:5432
>
>I am not familiar with this command, but it seems to be saying that you have
>a listening connection on the right port.
>
>Some other questions:
>
>1) If you use the IP instead of host name, do you get the same effect?
First I got error about ip not in pg_hba.conf, so I added
host all all 192.168.1.90 255.255.255.255 trust
- when I fixed that and rebooted, the system works!!! I then removed the
above line, rebooted and tried host=127.0.0.1 in pg_connect instead of
host=localhost and that works too! So why doesn't host=localhost work?
>2) Have you tried not specifying a host--in which case the Unix domain
>socket will be used--and does it work?
It doesn't work - but different error.
PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could
not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
in /php/class/phplib-7.4/db_pgsql.inc on line 51
I think I know what's causing this problem - apache is running with "chroot
/var/www" - a change in default install sometime between OpenBSD 2.9 and
3.5 - could this also be causing the problem with tcpip socket?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: fbax@sympatico.ca
Subject: Re: unable to connect to pgsql server
In-Reply-To: <5.2.1.1.0.20040526091656.02306cb0@pop6.sympatico.ca>
References: <5.2.1.1.0.20040524141824.02d7b060@pop6.sympatico.ca> <5.2.1.1.0.20040526091656.02306cb0@pop6.sympatico.ca>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox