Unable to load dynamic library pdo_pgsql.so

Bug #994194 reported by JazZ
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Undecided
Unassigned

Bug Description

At the bigining, I just updated ubuntu 10.04 to ubuntu 12.04. Everything worked excepted davical.

Davical enables me to to have a shared calendar, for personal et professional thinks. I have spent some time to debug davical, and I have see that it is impossible for davical (in php) to connect to PstGreSQL database through PDO. I have then chekced logs of apache, and I have found these errors :
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_mysql.so' - /usr/lib/php5/20090626+lfs/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_pgsql.so' - /usr/lib/php5/20090626+lfs/pdo_pgsql.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning: Module 'pgsql' already loaded in Unknown on line 0

So you can see that this bug affect pdo_sql and pdo_pgsql.

I have reinstalled php5-pgsql package, bug nothing happens. I have no idea to correct this bug.

Thanks in advance for your help.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: php5-pgsql 5.3.10-1ubuntu3
ProcVersionSignature: Ubuntu 3.2.0-23.36-generic-pae 3.2.14
Uname: Linux 3.2.0-23-generic-pae i686
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu7
Architecture: i386
Date: Thu May 3 21:59:12 2012
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: php5
UpgradeStatus: Upgraded to precise on 2012-04-20 (13 days ago)

Revision history for this message
JazZ (misterj-home) wrote :
Revision history for this message
JazZ (misterj-home) wrote :

Note that the concerned files exists.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

HI Jazz! Thanks for taking the time to file this bug report.

I notice the paths in your errors say /usr/lib/php5/20090626+lfs

The official packages do not have the '+lfs' in them. Is it possible you have a leftover config file (probably /etc/php5/conf.d/pdo_pgsql.ini) that has the wrong path in it?

Changed in php5 (Ubuntu):
status: New → Incomplete
Revision history for this message
JazZ (misterj-home) wrote :

Hi Clint,

Thanks for your help. It's important for me to do what I can do to improve a free software.

I have checked the file /etc/php5/conf.d/pdo_pgsql.ini :
; configuration for php PostgreSQL module
extension=pdo_pgsql.so

I have made a 'find / -name pdo_sql.so and the only file I have found is /usr/lib/php5/20090626+lfs/pdo_pgsql.so. When I uninstall php5-pgsql, the file disapears. When I reinstall it, the file appears.

I think, also that it is a problem of version between and newer, but I have no idea where to look for. But this line interested me : Module 'pgsql' already loaded in Unknown on line 0
I have checked /etc/pĥp5/conf.d, and there is two files pdo_pgsql.ini, and pgsql.ini, each not containing the same link (pdo_pgsql.so and pgsql.so). Same thing for mysql. Does I delete one these files ?

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

JazZ, this is extremely confusing.

Can you install php5-cli and run 'php -i | grep extension_dir' ?

On my 12.04 system, it shows:

extension_dir => /usr/lib/php5/20090626 => /usr/lib/php5/20090626

If that shows the same, can you place a file in your webroot with the content '<?php phpinfo();'

And look at what it says extension_dir is set to? Mine is also set to the same dir.

Also, perhaps you have modified config files in /etc/php5. You can check that with the 'debsums' package. Install it, and then run

debsums -e php5-common
debsums -e libapache2-mod-php5
debsums -e php5-pgsql

Revision history for this message
JazZ (misterj-home) wrote :

When i do 'php -i | grep extension_dir', I got:

 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_mysql.so' - /usr/lib/php5/20090626+lfs/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_pgsql.so' - /usr/lib/php5/20090626+lfs/pdo_pgsql.so: undefined symbol: pdo_parse_params in Unknown on line 0
extension_dir => /usr/lib/php5/20090626+lfs => /usr/lib/php5/20090626+lfs

So the directory is not exactly the same that yours. But directories returned by 'php -i', and phpinfo() are the same.

Concerning the php configuration, I know that in the past, I have followed a tutorial to improve the secutity of the server. But every thing worked and I dont think that I have changed some links (only php parameters).

But there is something more interesting when I do 'debsums -e php5-common' :
debsums: missing file /etc/php5/conf.d/pdo.ini (from php5-common package)
/etc/cron.d/php5 OK

I have reinstalled php5-common hoping to see this file created, but whitout any result. I have made also 'dpkg-reconfigure php5-common' without any result.

Others debsums worked well.

Revision history for this message
JazZ (misterj-home) wrote :

I have got it !

I have create a file pdo.ini which link to pdo.so, as it is the case for other ini files.

Debsums written me
/etc/php5/conf.d/pdo.ini FAILED
/etc/cron.d/php5 OK

But now, my calendar work !

Thanks a lot !

I am available to give you more information.

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 994194] Re: Unable to load dynamic library pdo_pgsql.so

Excerpts from JazZ's message of Sat May 05 16:10:33 UTC 2012:
> When i do 'php -i | grep extension_dir', I got:
>
> PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_mysql.so' - /usr/lib/php5/20090626+lfs/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0
> PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_pgsql.so' - /usr/lib/php5/20090626+lfs/pdo_pgsql.so: undefined symbol: pdo_parse_params in Unknown on line 0
> extension_dir => /usr/lib/php5/20090626+lfs => /usr/lib/php5/20090626+lfs
>
> So the directory is not exactly the same that yours. But directories
> returned by 'php -i', and phpinfo() are the same.
>
> Concerning the php configuration, I know that in the past, I have
> followed a tutorial to improve the secutity of the server. But every
> thing worked and I dont think that I have changed some links (only php
> parameters).
>
>
> But there is something more interesting when I do 'debsums -e php5-common' :
> debsums: missing file /etc/php5/conf.d/pdo.ini (from php5-common package)
> /etc/cron.d/php5 OK
>
> I have reinstalled php5-common hoping to see this file created, but
> whitout any result. I have made also 'dpkg-reconfigure php5-common'
> without any result.
>
> Others debsums worked well.

Aha! The directory change was a red herring.

The missing conf file is definitely the reason you're having
problems. Without pdo loaded, you can't load any of the pdo_* extensions.

dpkg -i --force-conf-missing /var/cache/apt/archives/php5-common_5.3.10-1ubuntu3_i386.deb

(I'm using the values in your apport collected bug report, but you get
the idea)

This will force dpkg to restore the packaged version of that file. Dpkg
always honors a missing config file, since you, the admin, would only
have removed it on purpose. So the --force-conf-missing will disable
that behavior and install any missing configuration files.

Revision history for this message
Ondřej Surý (ondrej) wrote :

Clint,

+lfs is arch dependent.

O.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Excerpts from Ondřej Surý's message of Sat May 05 18:40:58 UTC 2012:
> Clint,
>
> +lfs is arch dependent.

OOHHHHHhhhh! Thanks, will note that for the future. :)

Revision history for this message
JazZ (misterj-home) wrote :

"since you, the admin, would only have removed it on purpose"

I am sorry, I am not very good in English. But if you mean that I have removed this file, I can tell you that It's not my fault. Every thing worked until I updated ubuntu...

Revision history for this message
JazZ (misterj-home) wrote :

However, I can't remenber every thing I have done on this server. The initial installation of this last have 6 years, and I have never reinstalled ubuntu.

Revision history for this message
Mikhail Krestjanioff (mikhail-krestjaninoff) wrote :

I've got same bug on just installed OS. In my case extension dir was without "lfs" suffix - /usr/lib/php5/20090626.

As JazZ wrote before - solution is creation pdo.ini file with link to pdo.so module.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for php5 (Ubuntu) because there has been no activity for 60 days.]

Changed in php5 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers