Re: unable to connect to pgsql server
От | Frank Bax |
---|---|
Тема | Re: unable to connect to pgsql server |
Дата | |
Msg-id | 5.2.1.1.0.20040524102953.00a33080@pop6.sympatico.ca обсуждение исходный текст |
Ответ на | unable to connect to pgsql server (Frank Bax <fbax@sympatico.ca>) |
Список | 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@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
В списке pgsql-php по дате отправления: