pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Bax <fbax@sympatico.ca>
To: pgsql-php@postgresql.org
Subject: Re: unable to connect to pgsql server
Date: Mon, 24 May 2004 10:36:34 -0400
Message-ID: <5.2.1.1.0.20040524102953.00a33080@pop6.sympatico.ca> (raw)
In-Reply-To: <000d01c4419a$10d09290$0100a8c0@MAJOLEE1>
References: <5.2.1.1.0.20040524084521.02b48060@pop6.sympatico.ca>

At 10:18 AM 5/24/04, Majolee InfoTech wrote:
>This means that PHP is not configured to work with PostgreSQL.


If this were true, how can phpinfo() say pgsql support is enabled?

PostgreSQL Support enabled
PostgreSQL(libpq) Version  7.3.5
Multibyte character support  enabled
SSL support  disabled
Active Persistent Links  0
Active Links  0

Directive Local Value Master Value
pgsql.allow_persistent On On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice Off Off
pgsql.max_links Unlimited Unlimited
pgsql.max_persistent Unlimited Unlimited



>By the way checking for postmaster process being started before doing
>anything is worth here
>
>Try removing apache and PHP and then go thro this steps..
>
>[root@majolee7:/usr/local] # cd /root/src/
>
>[root@majolee7:/root/src] # gunzip apache_1.3.29.tar.gz
>
>[root@majolee7:/root/src] # tar -xvf apache_1.3.29.tar
>[root@majolee7:/root/src] # tar -xvf php-4.3.4.tar
>
>[root@majolee7:/root/src] # mv apache_1.3.29/ /usr/src
>
>[root@majolee7:/root/src] # mv php-4.3.4/ /usr/src
>
>[root@majolee7:/root/src] # cd /usr/src
>
>[root@majolee7:/usr/src] # cd apache_1.3.29/
>
>[root@majolee7:/usr/src/apache_1.3.29] # ./configure
>
>[root@majolee7:/usr/src/apache_1.3.29] # cd ..
>
>[root@majolee7:/usr/src/] # cd php-4.3.4/
>
>[root@majolee7:/usr/src/php-4.3.4] #
>
>[root@majolee7:/usr/src/php-4.3.4] #
>./configure --with-pgsql --with-apache=../apache_1.3.29 --enable-track-vars
>
>[root@majolee7:/usr/src/php-4.3.4] # make
>
>[root@majolee7:/usr/src/php-4.3.4] # make install
>
>[root@majolee7:/usr/src/php-4.3.4] # cd ..
>
>[root@majolee7:/usr/src] # cd apache_1.3.29/
>
>[root@majolee7:/usr/src/apache_1.3.29] #
>./configure --activate-module=src/modules/php4/libphp4.a
>
>[root@majolee7:/usr/src/apache_1.3.29] # make
>
>[root@majolee7:/usr/src/apache_1.3.29] # make install
>
>Open /usr/local/apache/conf/srm.conf File in to gEdit or Any Text Editor
>Add Follwing Line to the File & save the File
>Addtype application/x-httpd-php .php
>
>Open /etc/rc.d/rc.local File in to gEdit or Any Text Editor
>Add Follwing Line to the File & save the File
>/usr/local/apache/bin/apachectl start
>
>Hope this helps..
>
>===============
>Mihir & Biren
>Partners
>Majolee InfoTech
>===============
>----- Original Message -----
>From: "Frank Bax" <fbax@sympatico.ca>
>To: <pgsql-php@postgresql.org>
>Sent: Monday, May 24, 2004 7:07 PM
>Subject: [PHP] unable to connect to pgsql server
>
>
> > 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




view thread (7+ messages)  latest in thread

Message-ID: <5.2.1.1.0.20040524102953.00a33080@pop6.sympatico.ca>
Permalink:  ../5.2.1.1.0.20040524102953.00a33080@pop6.sympatico.ca/
Also on:    postgresql.org/message-id/5.2.1.1.0.20040524102953.00a33080@pop6.sympatico.ca

 · 

reply

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.20040524102953.00a33080@pop6.sympatico.ca>
  References: <5.2.1.1.0.20040524084521.02b48060@pop6.sympatico.ca> <5.2.1.1.0.20040524102953.00a33080@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