[meta: keywords: fatal error pg_connect pg_pconnect
mysql_connect mysql_pconnect linux turbolinux]
Here\\'s what I did to resolve the issue:
Added the following to the php.ini file:
extension_dir = <ext_dir>
extension = ldap.so
extension = mysql.so
extension = pgsql.so
Where, on my system, <ext_dir> just happened to be:
/usr/lib/php/extensions/no-debug-non-zts-20001214
Then, bounced the apache server; watch for errors on
restart with a \\"$ tail -f /etc/httpd/logs/error_log\\"
Observations made while pounding head:
- you don\\\'t need to add any path to /etc/ld.so.conf
- or run /sbin/ldconfig
- or alter /etc/httpd/conf/httpd.conf
- if the above shared libs came from an rpm,
you can find out which and where using (from bash):
$ rpm -qa | grep php | while read rpm ; do \\\\
rpm -ql $rpm | grep pgsql.so && echo $rpm; done
- to reassure that this shared lib has what you want:
$ nm <ext_dir>/pgsql.so | grep \\\' T .*pg_p*connect\\\'
- use the above \\\"rpm -qa\\\" sequence to find out where
your php.ini file is, if not in /etc/httpd.
The above assumes php is properly working; to check:
- create a php file, say \\"test.php\\", and with the following:
<body><?php phpinfo(); ?></body>
- bring up the page in your browser; you should see
a series of pretty purple tables, listing all sorts of
goodies, one especially relevant table row is the
\\"Configure Command\\" (got \\'--with-pgsql=shared\\'?).
If no \\'--with-pgsql=shared\\' (or \\'mysql\\', \\'ldap\\', or other
desired module), the apache server will need to be
reconfigured (beyond the scope of this reply, or my
knowledge, frankly).
If no phpinfo() at all, php isn\\'t even set up. Mine was mostly
configured with the rpm install scripts. You\\'ll need to have
a libphp4.so shared lib (if php4), on your system. Use the
above \\"rpm -qa\\" sequence to find out where it resides. You
may also get a better understanding of what\\'s involved by
reviewing the install and unstall scripts for the rpm; here\\'s
what I had:
- $ rpm -q -scripts php-4.0.4
postinstall script (through /bin/sh):
/usr/sbin/apxs -i -a -n php4 /usr/lib/php/libphp4.so
postuninstall script (through /bin/sh):
if [ \\\"$1\\\" = 0 ]
then
cat /etc/httpd/conf/httpd.conf \\\\
| grep -v \\\"LoadModule php4_module\\\" \\\\
| grep -v \\\"AddModule mod_php4.c\\\" \\\\
> /etc/httpd/conf/httpd.conf.new
mv /etc/httpd/conf/httpd.conf.new \\\\
/etc/httpd/conf/httpd.conf
rm -f /usr/libexec/apache/libphp4.so
fi
So basically, you\\'ll need to call \\"apxs\\" (as above), and
add a few lines to your /etc/httpd/conf/httpd.conf file:
LoadModule php4_module /usr/libexec/apache/libphp4.so
AddModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Bounce apache, and that\\'d be it.