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

Re: unable to connect to pgsql server

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: unable to connect to pgsql server
Date: 2004-05-24 14:36:34
Message-ID: 5.2.1.1.0.20040524102953.00a33080@pop6.sympatico.ca (view raw or flat)
Thread:
Lists: pgsql-php
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(at)majolee7:/usr/local] # cd /root/src/
>
>[root(at)majolee7:/root/src] # gunzip apache_1.3.29.tar.gz
>
>[root(at)majolee7:/root/src] # tar -xvf apache_1.3.29.tar
>[root(at)majolee7:/root/src] # tar -xvf php-4.3.4.tar
>
>[root(at)majolee7:/root/src] # mv apache_1.3.29/ /usr/src
>
>[root(at)majolee7:/root/src] # mv php-4.3.4/ /usr/src
>
>[root(at)majolee7:/root/src] # cd /usr/src
>
>[root(at)majolee7:/usr/src] # cd apache_1.3.29/
>
>[root(at)majolee7:/usr/src/apache_1.3.29] # ./configure
>
>[root(at)majolee7:/usr/src/apache_1.3.29] # cd ..
>
>[root(at)majolee7:/usr/src/] # cd php-4.3.4/
>
>[root(at)majolee7:/usr/src/php-4.3.4] #
>
>[root(at)majolee7:/usr/src/php-4.3.4] #
>./configure --with-pgsql --with-apache=../apache_1.3.29 --enable-track-vars
>
>[root(at)majolee7:/usr/src/php-4.3.4] # make
>
>[root(at)majolee7:/usr/src/php-4.3.4] # make install
>
>[root(at)majolee7:/usr/src/php-4.3.4] # cd ..
>
>[root(at)majolee7:/usr/src] # cd apache_1.3.29/
>
>[root(at)majolee7:/usr/src/apache_1.3.29] #
>./configure --activate-module=src/modules/php4/libphp4.a
>
>[root(at)majolee7:/usr/src/apache_1.3.29] # make
>
>[root(at)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(at)sympatico(dot)ca>
>To: <pgsql-php(at)postgresql(dot)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


In response to

pgsql-php by date

Next:From: Keary SuskaDate: 2004-05-24 16:02:03
Subject: Re: unable to connect to pgsql server
Previous:From: Frank BaxDate: 2004-05-24 13:37:19
Subject: unable to connect to pgsql server

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