I’m going to assume you already have nginx and php-fpm installed and running.

  1. php5-mcrypt should be installed already (it comes bundled with php5-fpm). Just for safety,
    apt-get install php5-mcrypt
  2. Create symlink to mods-avaliable,
    ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
  3. Enable it.
    php5enmod mcrypt
  4. Restart php-fpm,
    service php5-fpm restart
  5. Restart nginx,
    service nginx restart

Done!

6 Comments

  1. Dmitry V. Alexeev

    Hello David!

    There are some unnecessary steps in your tutorial. First of all you don’t need to restart nginx. php5-fpm has nothing to do with nginx. Nginx is just a proxy server. And you don’t need to create a symlink.

    1. apt-get install php5-mcrypt
    2. php5enmod mcrypt
    3. service restart php5-fpm

  2. Andrea Grandi

    Hi, excuse me, but I’ve Ubuntu 14.04, Nginx and php5-fpm installed and running.
    There is no /etc/php5/conf.d/ directory. “conf.d” is under /etc/php5/fpm/conf.d/
    Anyway… the file mcrypt.ini is there, I also enabled it with command php5enmod mcrypt and I verified that is there with this:

    [email protected]:/etc/php5$ php5-fpm -m | grep mcrypt
    mcrypt

    but when I try to use a WordPress plugin that requires it, I get the same error that the library is missing.

    How can I fix this?

    1. Arran Fraser

      This happened to me too Andrea. I eventually discovered that the libmcrypt files themselves were missing. Something like this is what fixed it for me:

      [code]
      apt-get remove php5-mcrypt
      apt-get autoremove
      apt-get install php5-fpm
      apt-get install php5-mcrypt
      [/code]

Leave a Reply

Your email address will not be published. Required fields are marked *