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

Follow

Comments

6 comments

  • Avatar
    Jacob Bowen

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

    -1
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Jacob,

    Thank you, I've created a corresponding feature suggestion: https://plesk.uservoice.com/forums/184549-feature-suggestions/suggestions/38282788-add-mcrypt-module-to-plesk-php-7-2-and-newer?

    Feel free to vote for and comment it.

    0
    Comment actions Permalink
  • Avatar
    eurogood

    It seems like https://github.com/phpseclib/mcrypt_compat might be the ideal option when mcrypt isn't available.

    0
    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.

    0
    Comment actions Permalink
  • Avatar
    VG

    Hi,

     

    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 mcrypt.so extension to php.ini.

    The output will look like this:

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

    Enable the extension in PHP configuration:

     echo 'extension=mcrypt.so' > /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"

     

    Cheers

     

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello,

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

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request