How to install the php-mcrypt module on a Plesk server




  • Avatar
    Jacob Bowen

    Mcrypt updated to 1.0.2 which is fully compatible with 7.2 and 7.3. Please update 

    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Jacob,

    Thank you, I've created a corresponding feature suggestion:

    Feel free to vote for and comment it.

    Comment actions Permalink
  • Avatar

    It seems like might be the ideal option when mcrypt isn't available.

    Comment actions Permalink
  • Avatar
    Daria Gavrilova

    Hello @eurogood,

    Thank you for your input.

    Indeed mcrypt_compat can be used, however, please note that it was not tested with Plesk yet and mcrypt_compat can be installed on your own risk only.

    Comment actions Permalink
  • Avatar



    This article it's incomplete. In order to build the library, C++ compiler is needed. If you don't have it, builder will fail. Btw, today the stable working version is 1.0.3.


    Adapted from Stackoverflow thread:


    Install dependencies and mcrypt library with pecl

     sudo apt-get -y install gcc make autoconf libc-dev pkg-config
     sudo apt-get -y install libmcrypt-dev plesk-php72-devel
     sudo pecl install mcrypt-1.0.3

    When you are shown the prompt

    libmcrypt prefix? [autodetect] :

    Press [Enter] to autodetect.

    After success installing mcrypt trought pecl, you should add extension to php.ini.

    The output will look like this:

    Build process completed successfully
    Installing '/opt/plesk/php/7.2/lib/php/modules/'    ---->   this is our path to mcrypt extension lib
    install ok: channel://
    configuration option "php_ini" is not set to php.ini location
    You should add "" to php.ini

    Enable the extension in PHP configuration:

     echo '' > /opt/plesk/php/7.2/etc/php.d/mcrypt.ini

    Refresh and Reload

     sudo plesk bin php_handler --reread
    sudo service apache2 reload
    sudo service plesk-php72-fpm reload

    Check that everything is working

    php -i | grep "mcrypt"




    Comment actions Permalink
  • Avatar
    Ivan Postnikov


    Thank you for the message, this may be useful for other Pleskians.

    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request