From: Frank Bax <fbax@sympatico.ca>
To: pgsql-php@postgresql.org
Subject: unable to connect to pgsql server
Date: Mon, 24 May 2004 09:37:19 -0400
Message-ID: <5.2.1.1.0.20040524084521.02b48060@pop6.sympatico.ca> (raw)
I have a working system on OpenBSD 2.9 / PHP 4.0.4pl1 / pgsql 7.1 / phplib 7.4
I created a new system on OpenBSD 3.5 / PHP 4.3.5RC3 / pgsql 7.3.5 / phplib 7.4
I copied an existing database and php/phplib application to the new box for
testing, but when I try to access the application webpage, I get the
following message in apache error log:
PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: unknown
host name: localhost in /php/class/phplib-7.4/db_pgsql.inc on line 51
Line 51 of db_pgsql.inc calls pg_connect (obviously?). Since all code came
from a working system, I think I missed something during setup, but I'm not
sure what that might be. Based on similar questions in archives, I think
this info is relevant:
# cat /var/pgsql/data/postgresql.conf | grep -v ^# | grep -v ^$
tcpip_socket = true
shared_buffers = 512
LC_MESSAGES = 'C'
LC_MONETARY = 'C'
LC_NUMERIC = 'C'
LC_TIME = 'C'
# cat /var/pgsql/data/pg_hba.conf | grep -v ^#
local all all trust
host all all 127.0.0.1 255.255.255.255 trust
# cat /etc/hosts | grep -v ^#
::1 localhost
127.0.0.1 localhost
Frank
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.20040524084521.02b48060@pop6.sympatico.ca>
References: <5.2.1.1.0.20040524084521.02b48060@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