php5-mysql mixed with pdo and pdo_mysql causes apache to failed to load.
Apache, php, ubuntu February 26th, 2008I am running ubuntu 7.10
I had previously installed php with pdo, and added the pdo_mysql and pdo
extension into the /etc/php5/apache2/php.ini file.
Once i then tried to install php5-mysql via apt-get php segfaulted and
apache refused to restart.
With the pdo and pdo_mysql extension in php.ini i was getting the
following error from /var/log/apache2/error.log..
PHP Warning: Module ‘PDO’ already loaded in Unknown on line 0
PHP Warning: Module ‘pdo_mysql’ already loaded in Unknown on line 0
/usr/sbin/apache2: symbol lookup error: /usr/lib/php5/20060613
+lfs/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce
Once i commented out the pdo extension, this got rid of the first PHP
warning, and pdo is in phpinfo but no pdo drivers..
If i comment out pdo_mysql in /etc/php5/apache2/php.ini and also
commented it out from /etc/php5/conf.d/pdo_mysql.ini and restarted
apache then it worked.
Bottom line is, if anywhere at all you have pdo_mysql.so in any
configuration, you get the error:
/usr/sbin/apache2: symbol lookup error: /usr/lib/php5/20060613
+lfs/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce
and apache fails to load.
Server version: Apache/2.2.4 (Ubuntu)

February 29th, 2008 at 12:25 am
I have also submitted a bug to ubuntu bugs (Please add to this to help get this sorted):
https://bugs.launchpad.net/ubuntu/+bug/196903
Ubuntu Forums: http://ubuntuforums.org/showthread.php?p=4409674
Debian Bugs: http://www.mail-archive.com/debian-bugs-closed@lists.debian.org/msg115619.html
——————
###############
# Summary
###############
When install php5-mysql in conjuntion with pdo_mysql, php segfaults and dies caushing apache2 to fail to start.
Have tried various solutions including renaming pdo_mysql.ini to zpdo_mysql.ini (so apache loads after pdo.ini) .. no good.
Bug is reported as being ‘done’ here, yet it isn’t and there is no way to reopen the bug… http://www.mail-archive.com/debian-bugs-closed@lists.debian.org/msg115619.html
###############
# Recreate the bug
###############
When installing via apt-get… i run the following. . .
Install Apache 2
sudo apt-get install apache2
sudo a2enmod rewrite
Install MySQL
sudo apt-get install mysql-server libmysqlclient15-dev
Install PHP
sudo apt-get install php5 php5-common libapache2-mod-php5 php5-gd php5-dev curl libcurl3 libcurl3-dev php5-curl php-pear php5-mysql
Install PDO & PDO _ MYSQL
sudo pecl install pdo
sudo pecl install pdo_mysql
echo “extension=pdo.so” | sudo tee -a /etc/php5/apache2/php.ini
echo “extension=pdo_mysql.so” | sudo tee -a /etc/php5/apache2/php.ini
###############
# Error Output from /var/log/apache2/error.log
###############
/usr/sbin/apache2: symbol lookup error: /usr/lib/php5/20060613+lfs/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce
###############
# Additional Links
###############
My Blog Post: http://www.theatons.com/blog/2008/02/26/php5-mysql-mixed-with-pdo-and-pdo_mysql-causes-apache-to-failed-to-load/
Ubuntu Forums: http://ubuntuforums.org/showthread.php?p=4409674
Debian Bugs: http://www.mail-archive.com/debian-bugs-closed@lists.debian.org/msg115619.html
###############
# Additional System information
‘###############
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION=”Ubuntu 7.10″
March 15th, 2008 at 6:48 pm
I have the same problem too. The failure is due to missing on mysql.so in PHP 5.2, php5-mysql is now providing mysqli.so only.
To fix the problem, you have to install the old mysql.so through PECL
pecl install mysql
Then add the mysql.so in your php.ini
If still fails, try to remove the pdo and pdo_mysql and reinstall it
Here is the summarize install steps for PECL:
pecl install mysql
pecl install pdo
pecl install pdo_mysql
March 17th, 2008 at 11:47 am
Benny, thanks for the HOWTO! It worked for me!
April 21st, 2008 at 4:56 pm
[...] howto 整个 Yo2 上的相关文 :Ubuntu 8.04 Alpha 1发布 Ubuntu 8.04 Hardy Heron发布时间表 Ubuntu 8.04 Themes Ubuntu 8.04 Hardy Heron发布时间表 Ubuntu 8.04 LTS (Hardy Heron) Alpha 1 下载 printYo2FavControl(”",”",”jeos-8.04 to lamp for symfony”,”sudo apt-get install apache2 php5 php5-dev php-pear ssh sudo apt-get install mysql-server sudo apt-get install php5-mysql postfix build-essential libmysqlclient15-dev vsftpd sudo pecl install pdo sudo pecl install pdo_msyql 遭遇 php_pdo_get_dbh_ce 解决方法”);最近阅读过此文 的网友: [...]
December 27th, 2008 at 7:03 pm
Went to install a pre-alpha of drupal 7 which requires PDO and ran into this problem on ubuntu 8.04. Found a solution at
http://www.buggy.id.au/2007/02/19/installing-pdo-on-ubuntu/
which says to install the libmysqlclient15-dev
package before installing pdo.