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

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

Question

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

Answer

Note: Following instructions below, the module will be installed for PHP version supplied by OS vendor. Plesk PHP handlers are shipped with the mcrypt module by default. PHP handlers provided by Plesk can be selected in Domains > example.com > PHP settings.

  1. Connect to a Plesk server via SSH.
  2. Install the module:
    • for CentOS/RHEL-based distributions:

      The php-mcrypt package is available from RPMforge and EPEL repositories. Add the repository to the server and install the package using the yum utility:

      # yum install epel-release
      # yum install php-mcrypt

    • for Debian/Ubuntu-based distributions:

      Find out the system PHP version:

      # php -v

      • if PHP 5.x version is installed:

        # apt-get install php5-mcrypt

      • if PHP 7.x version is installed:

        # apt-get install php-mcrypt

  3. If the mcrypt module has not appeared at Tools & Settings > PHP Settings > [name of PHP handler] > Extensions page, refresh server components by opening Tools & Settings > Server Components and clicking Refresh.
  4. To make mcrypt module available for existing websites, update their PHP settings with the command:

    # /usr/local/psa/bin/php_settings -u

Warning: The mcrypt module is deprecated since PHP 7.2 and it will be moved out of core and into PECL: https://wiki.php.net/rfc/mcrypt-viking-funeral

發表評論

This site uses Akismet to reduce spam. Learn how your comment data is processed.