php5-mysql and pdo / pdo_mysql causes php to segfault, apache2 fails to start

Bug #196903 reported by ntom-taylor
2
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

###############
# 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://<email address hidden>/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://<email address hidden>/msg115619.html

###############
# Additional System information
'###############
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"

Revision history for this message
Chuck Short (zulcss) wrote :

If possible can you please test this on hardy?

Thanks
chuck

Changed in php5:
status: New → Incomplete
Revision history for this message
Chuck Short (zulcss) wrote :

No response from user.

Closing

Changed in php5:
status: Incomplete → Invalid
Revision history for this message
Michael Ekoka (verysimple) wrote :

Description of problem and resolution, for documentation purpose, because I ran into this on Karmic:

- apache, php, libapache2-mod-php5, mysql-server have been installed via package manager (apt, adept, etc).
- then pdo and pdo_mysql were installed via pecl. pdo.ini and pdo_mysql.ini are manually created in /etc/php5/conf.d/ with instructions to load these extensions. Up to now lamp runs fine for php code that relies on pdo to connect to mysql.
- later on, php5_mysql is installed via apt-get and upon restarting apache, it seems to restart "OK", but can't resolve to virtualhosts anymore. The error logs (/var/log/apache/error.log) may contain this message:

    /usr/sbin/apache2: symbol lookup error: /usr/lib/php5/20060613/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce

You might see the same message if you run php from the shell.

Resolution: it seems that pdo and pdo_mysql need to be installed *after* php5_mysql, so uninstall both with pecl (don't forget to comment out their ini files in /etc/php5/conf.d/). If php5_mysql isn't yet installed, do so with apt (or derivative), make sure the mysql.ini file gets created in /etc/php5/conf.d/. If it doesn't, create one manually:

echo "extension=mysql.so" | sudo tee /etc/php5/conf.d/mysql.ini

Now, reinstall pdo and pdo_mysql (via pecl). Uncomment their conf file's contents. Restart apache. Things should be back to normal.

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

Why did you installed pdo_mysql from pecl anyway? php5-mysql includes pdo_mysql.so:

http://packages.ubuntu.com/karmic-updates/amd64/php5-mysql/filelist

The thing is that if you mess with linking libraries yourself (and then rewriting some of them via package), then most times you're on your own.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.