On Tue, 7 Jun 2011 08:21:27 -0700, Shad Keene wrote:
I'm getting some errors all of a sudden when using PHP and Perl to connect to my postgresql database.
I'm running Red Hat Enterprise Linux Client release 5.6 (Tikanga)
And php-5.1.6-27.el5_5.3
perl-5.8.8-32.el5_5.2
Here's the php error when trying to connect:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_pgsql.so' - libpq.so.4: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pgsql.so' - libpq.so.4: cannot open shared object file: No such file or directory in Unknown on line 0
And the perl error:
install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 3) line 3.
Perhaps the DBD::Pg perl module hasn't been fully installed,
or perhaps the capitalisation of 'Pg' isn't right.
Available drivers: DBM, ExampleP, File, Proxy, Sponge, mysql.
at pg_connect.pl line 9
This is strange because the same exact scripts worked about a month ago. And I do have DBD/pg.pm installed and pgsql.so and pdo_pgsql.so are also installed.
Is there a simple fix to this? I have read some ideas about installed libpq.so.4 to fix this, but I wanted to run this specific problem by some experts before making any changes.
Thanks for any help,
S
It's seems library libpq.so.4 missing on your server. This can happened if you upgrade your postgresql.
For perl use:
perl -MCPAN -e shell
and then:
install DBD::Pg
For perl this is happened when you update your perl version or postgresql library is missing or is not installed.
-- Regards, Condor