So this morning I used aptitude to install a few security updates. Seemed innocent enough until stuff stopped working. Somewhere along the way, a few packages got dropped, I guess. Now PHP (specifically PHP5-FPM) doesn't think it's connected to MySQL and I have no idea why. All packages seem to be installed. According to phpinfo():

  • The php.ini file from /etc/php5/fpm.
  • An additional /etc/php5/fpm/conf.d/mysql.ini file is being parsed (among others)
  • The mysql.ini file includes this line:


Installed PHP-related packages:

$ dpkg --get-selections | grep php  
libapache2-mod-php5       install
php-pear          install
php5            install
php5-cgi          install
php5-cli          install
php5-common         install
php5-curl         install
php5-dev          install
php5-fpm          install
php5-gd           install
php5-mcrypt         install
php5-memcache         install
php5-mysql          install

Installed MySQL packages:

$dpkg --get-selections | grep mysql
libdbd-mysql-perl       install
libmysqlclient-dev        install
libmysqlclient18        install
mysql-client-5.5        install
mysql-client-core-5.5       install
mysql-common          install
mysql-server          install
mysql-server-5.5        install
mysql-server-core-5.5       install
php5-mysql          install

Services status:

$ sudo service --status-all
 [ + ]  memcached
 [ ? ]  mysql
 [ ? ]  network-interface
 [ ? ]  network-interface-container
 [ ? ]  network-interface-security
 [ ? ]  networking
 [ + ]  nginx
 [ + ]  php5-fpm
 [ + ]  ssh

As you might expect from the services output, this is a nginx+php5-fpm+mysql install. Although status-all shows unknown, the mysql service is running (confirmed w/ ps).

Granted, I'm no sysadmin (!), but I've exhausted everything I can find or think of that would prevent the MySQL extension from being loaded. If anyone can offer any guidance I'd very much appreciate it. No doubt I'm missing something fundamental, but I'm at a loss right now for what it might be.



For whatever it might be worth, when looking at the phpinfo output, I also don't see groups for curl or gd, but do see groups for mcrypt and memcache. I'm not sure what to make of that. If I try to install php5-mysql, apt just tells me it's already installed.

  • What version of php are you using. php5.3 and newer has MySQL-ND built in. – Ben Lessani - Sonassi Sep 18 '12 at 18:19
  • @sonassi: PHP 5.3.10. I'm not sure what the MySQL-ND package is or how it impacts what I'm trying to do. This worked yesterday with PHP 5.3 and whatever config I hadn't yet blown up. – Rob Wilkerson Sep 18 '12 at 18:21
  • Have you tried restarting php5-fpm? – Michael Hampton Sep 18 '12 at 18:26
  • @MichaelHampton - Definitely. – Rob Wilkerson Sep 18 '12 at 19:01
  • @MichaelHampton - Whoa. I have done it several times (confirmed in history), but apparently I've done something in the meantime and the combination of things was magical. Thanks for prompting me to do it again. – Rob Wilkerson Sep 18 '12 at 19:05

Have you tried restarting php5-fpm? apt should restart it during the upgrade, but sometimes it gets the timing wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.