12.04 Dist-upgrade breaks PHP extensions > pdo_mysql.so symbols
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php5 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Bug Report: PHP Unable to load dynamic library pdo_mysql.so
[ Basic Information | Desired/Actual Behaviour | Steps to reproduce | More Info (incl. PHP Info) | System Information | Apport]
Hopefully I have included all relevant information here. Please let me know if you need more or if anything is unclear :)
Basic Information: Ubuntu 12.04 LTS x64, Apache 2.2.22 (Built Feb 13 2012), PHP 5.4.1 (although DPKG states installed packages are php5_5.3.10), php5-mysql (*not* php5-mysqlnd)
Desired Behaviour:
Launch PHP with PDO mysql_driver error free, enabled and working.
Actual Behaviour:
PHP launches with error in logfile:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/
Steps to Reproduce:
Install Ubuntu 12.04 LTS
Successfully install php5, php-mysql using apt-get (no errors or warnings):
sudo apt-get install php5
sudo apt-get install php5-mysql
Install Symfony and Streeme with instructions on Google Code (basically svn co http://
Perform package & distribution upgrade:
apt-get dist-upgrade
Start PHP:
service apache2 restart
Receive warning in error log:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/
[Further steps to reproduce]
Attempt to rescan music (./symfony scan-media --type=filesystem)
Receive warning:
Couldn't locate driver named mysql
More Info:
[ Description | PHP Info | Related Files ]
I have recently upgraded (via sudo apt-get dist-upgrade) my system to 12.04 Ubuntu x64.
Previously I had a very nice app called Streeme, which I used to listen to my music anywhere. It uses a framework called Symfony (Streeme requires Symfony <=1.4), and hooks into a mySQL database where it stores all of it's 'stuff' (library info, paths, users, etc).
I have a working PHP5 and mySQL setup on the machine. This is verified by the use of eGroupware and phpMyAdmin (plus PHP scripts which will happily talk to the mySQL database using mysql_connect()). Four weeks ago the Apache2 webserver apache2 was replaced in place with the apache2-mtm-itk package to allow the webserver to function with different UIDs. This was reversed two weeks ago, but the problem still exists. Before, during and after there was no issue with mySQL access through phpMyAdmin or eGroupware, or a PHP script.
Attempting to revive Streeme after the upgrade (not everything works directly after an upgrade and from experience a new Streeme installation is preferable to stitching an old one together, although I don't know why- plus the hard drive with all the music on it got a kicking from which it could not recover, so I might as well start again!) has totally failed with the error:
Couldn't locate driver named mysql
Obviously this is a symfony framework error. However, I know that mysql should be available. After some investigation, it turns out Symfony uses PDO (particularly pdo_mysql) to access the database (and, in turn, during a media scan or doctrine installation (think bootstrapping) PHP directs Symfony). Further investigation directed me to check that the pdo was enabled correctly, so please see the following from php_info():
Loaded Configuration File /etc/php5/
.ini files parsed: ... /etc/php5/
PHP API 20090626
PHP Extension 20090626
extension_dir /usr/lib/
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 5.5.24
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/
MYSQL_INCLUDE -I/usr/
MYSQL_LIBS -L/usr/
mysql.allow_
mysql.allow_
mysql.connect_
mysql.default_host no value no value
mysql.default_
mysql.default_port no value no value
mysql.default_
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_
mysql.trace_mode Off Off
PDO
PDO support enabled
PDO drivers mysql, sqlite
So PDO is, theoretically, enabled. There is a similar output when using the CLI configuration file (/etc/php5/
However there is an error appearing in the PHP error log:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/
Which seems to indicate that there is no file there (which is not true):
-rw-r--r-- 1 root root 31056 Jun 13 18:36 /usr/lib/
(In fact, all PDO related symbols have a timestamp of June 13, 18:36)
I have checked in all /etc/php5/*/ folders for conf.d/pdo.ini, mysql.ini, pdo_mysql.ini and they all exist and have the correct directives:
[e.g:]
; configuration for php PDO module
extension=pdo.so
But if I ask for the extension_dir using: php -c /etc/php2/
extension_dir => /usr/local/
This directory (/usr/local/
So it seems that somewhere, most likely in some upgrade, this file was altered and refuses to load, causing symfony, and other packages which depend on the mysql PDO driver, to fail.
I have tried to dpkg-reconfigure the various packages mentioned below but it does not fix the problem. Everything else to do with PHP works. I can only see that this is a bug with PHP which is causing symfony to fail to find the correct drivers it requires. This has worked previously on this machine.
Further Information:
[ PHP Version | Debsums | PHP Package versions | OS Information | ldd Output ]
Output of php -c /etc/php5/apache2 --version
PHP 5.4.1 (cli) (built: Apr 29 2012 18:27:47)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
Debsums info:
debsums -e php5-common
/etc/php5/
/etc/cron.d/php5 OK
debsums -e libapache2-mod-php5
/etc/apache2/
/etc/apache2/
debsums -e php5-mysql
/etc/php5/
/etc/php5/
/etc/php5/
PHP Installed Packages (despite php --version stating PHP version is 5.4.1)
php5_5.
php5-cli_
php5-common_
php5-curl_
php5-dev_
php5-gd_
php5-ldap_
php5-mysql_
php5-sqlite_
php-db_
php-geshi_
php-http_
php-pear_
apt-cache policy php5
php5:
Installed: 5.3.10-1ubuntu3.2
Candidate: 5.3.10-1ubuntu3.2
Version table:
*** 5.3.10-1ubuntu3.2 0
500 http://
500 http://
100 /var/lib/
5.
500 http://
apt-cache policy php5-mysql
php5-mysql:
Installed: 5.3.10-1ubuntu3.2
Candidate: 5.3.10-1ubuntu3.2
Version table:
*** 5.3.10-1ubuntu3.2 0
500 http://
500 http://
100 /var/lib/
5.
500 http://
php5-common:
Installed: 5.3.10-1ubuntu3.2
Candidate: 5.3.10-1ubuntu3.2
Version table:
*** 5.3.10-1ubuntu3.2 0
500 http://
500 http://
100 /var/lib/
5.
500 http://
Release Information: lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04
OS Information: uname -a
Linux [snip] 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
ldd /usr/lib/
libc.so.6 => /lib/x86_
libz.so.1 => /lib/x86_
libdl.so.2 => /lib/x86_
libm.so.6 => /lib/x86_
Apport:
Unfortunately apport has not registered a crash.
apport-cli -p php5 --save ~/php5.bug
No pending crash reports. Try --help for more information.
apport-cli -p php5-mysql --save ~/php5mysql.bug
No pending crash reports. Try --help for more information.
Hi, and thank you for taking the time to file such a detailed bug report!
"PHP Installed Packages (despite php --version stating PHP version is 5.4.1)"
Your cli PHP version is different than the libapache2-mod-php5 version. I suspect you have installed a version of php in /usr/local/bin that is not from the repositories.
Since the setup instructions have you running commands with the PHP CLI, this is likely to cause problems, if not confusion.
I ran through the entire install of streeme (cool app!) and it works flawlessly with a clean brand new installed precise system.
Unless there is some step I've missed, I don't think this is an issue we can solve in Ubuntu. Please feel free to set the bug back to 'New' if you disagree, or open a new bug with 'ubuntu-bug php5'.