Can't use PHP extension Mcrypt in Ubuntu 13.10 (Nginx, PHP-FPM)

I had the same problem after I upgraded to 13.10 this evening. Apparently this is a genuine Ubuntu 13.10 bug: “phpmyadmin do not recognize php5-mcrypt”. The PHP modules got moved from the conf.d directory to the mods-available directory, and the mcrypt module got left behind.

To fix it I put a symlink to the mcrypt.ini file in the PHP config.

Apache

If you use Apache (rather than php-fpm):

sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
sudo service apache2 restart

php-fpm

Or for php-fpm (rather than Apache):

  1. Make symbolic link to ini files in mods-available

    sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
    
  2. Enable mods

    sudo php5enmod mcrypt
    
  3. Restart FPM

    sudo service php5-fpm restart
    

Tags:

Nginx

Php

Laravel