Starting on October 19, 2021, we will enable single-sign-on for our Plesk Support Center to provide a seamless login/account experience. This implies that you’ll be able to use a single account across any of our web-facing properties.
To be prepared for this change and to avoid the need to register during your next ticket submission after the change, we encourage you to create an account here before October 19 using the same email address as your current Zendesk login (support account). It’s essential that you use the same email address on our support center to ensure that your tickets stay attached to the same account. You will continue to use ZenDesk authentication until we switch over to single-sign-on on October 19th.

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

Follow

Comments

14 comments

  • Avatar
    Jacob Bowen

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

    0
    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
  • Avatar
    ibrahim sayar

    nice content, i tried it works !

    0
    Comment actions Permalink
  • Avatar
    Ryan Johnson (Edited )

    This is out of date by a long shot, even though it says you updated it a month ago. Plesk 7.4.7 uses mcrypt-1.0.3 when installing via pecl:

    # /opt/plesk/php/7.4/bin/pecl install mcrypt-1.0.3

    Also, your instruction assumes the user uses apache2, when this is a bad assumption. I use nginx, because Apache is old and slow and limited. Corrections:

    # service nginx reload
    # service plesk-php74-fpm reload
    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Ryan Johnson

    Thank you for your comment, I have updated the article accordingly.

    0
    Comment actions Permalink
  • Avatar
    Webbing

    On the 2nd line for CentOS

    yum install --enablerepo=epel -y plesk-php72-devel gcc libmcrypt-devel

    ... you need to add the "make" library well in order to be able to compile.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Webbing

    "make" is included in the minimal CentOS installation, for example: https://gist.github.com/ozuma/552276c5d8e38b72f91d

    I've also verified it on a test server.

    0
    Comment actions Permalink
  • Avatar
    Webbing

    Ivan Postnikov apparently not if you are installing it on CentOS 8.2. I ran into this issue last week...

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Webbing

    Thank you for the clarification.

    I've updated the article with "make" installation. If make is already present, it will be updated.

    BTW, on a test server, I have CentOS 8.1.1911 and "make" was present =)

    0
    Comment actions Permalink
  • Avatar
    Md Rasel Khan

    Thanks!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request