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

Solution 1:

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
    

Solution 2:

Or, use:

sudo apt-get install php5-mcrypt

Im not sure of this will work on standard php installs - I installed php 5.5.7 using the package from:

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update