Enable Mcrypt extension in NginX?

July 27, 2014 23.1k views

Hi all. After i installed phpMyAdmin on NginX, i found that mcrypt extension wasn't enabled yet. I tried enabling mcrypt extension by this command :"sudo php5enmod mcrypt" and restart nginx. But it didn't work. Please help me :)

3 Answers

Hi Hoang!

I had the same issue however I am not using phpMyAdmin. I found this and it worked like a charm..


apt-get install php5-mcrypt

Create symlink to mods-avaliable

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

Enable It.

php5enmod mcrypt

Restart php-fpm

service php5-fpm restart

Restart nginx

sudo service nginx restart
  • Thank you, I only had to "sudo" the third and fourth step.

  • With symlink I keep getting this error?

    ln: failed to create symbolic link ‘/etc/php5/mods-available/mcrypt.ini’: File exists

    any ideas why?

  • @jasonkingweb That's fine, it means that /etc/php5/mods-available/mcrypt.ini already exists, so you only need to run php5enmod and restart php5-fpm and nginx.

Have another answer? Share your knowledge.