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

unable to connect to pgsql server

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-php(at)postgresql(dot)org
Subject: unable to connect to pgsql server
Date: 2004-05-24 13:37:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-php
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/ on line 51

Line 51 of 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

# cat /var/pgsql/data/pg_hba.conf   | grep -v ^#
local   all         all                                             trust
host    all         all   trust

# cat /etc/hosts | grep -v ^#
::1 localhost localhost



pgsql-php by date

Next:From: Frank BaxDate: 2004-05-24 14:36:34
Subject: Re: unable to connect to pgsql server
Previous:From: ChrisDate: 2004-05-21 06:34:00
Subject: Re: Sessions and serializing (was: Checking data inserted

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