Using the mcrypt extension for PHP 7.2 and above
Using the mcrypt extension for PHP 7.2 and above
Introduction
The mcrypt extension has been deprecated by PHP developers, so it is not available via cPanel's EasyApache. Applications should instead use sodium or OpenSSL for encryption.
It may be possible to use the mcrypt extension in PHP 7.2 and above, but this is not supported by cPanel. Below are instructions you may attempt, but ultimately, cPanel cannot guarantee they will work.
Procedure
-
- Install the libmcrypt package:
-
AlmaLinux, CentOS, CloudLinux, and Rocky Linux:
yum install libmcrypt
-
Ubuntu
apt install libmcrypt
-
- Install the libmcrypt package:
- Install the EPEL repository (not required on Ubuntu):
yum install epel-release
- Install the libmcrypt-devel package:
- AlmaLinux, CentOS, CloudLinux, and Rocky Linux
yum install libmcrypt-devel
- Ubuntu
apt install libmcrypt-dev
- AlmaLinux, CentOS, CloudLinux, and Rocky Linux
- Install mcrypt via PECL:
/opt/cpanel/ea-php##/root/usr/bin/pecl install mcrypt
Please note that you will need to replace ea-php## with the needed PHP version.
If your server is making use of LiteSpeed, be sure to restart detached PHP processes with the following steps:
- Log in to WHM as the root user.
- Navigate to "Home / Plugins / LiteSpeed Web Server Plugin."
- Click the "Restart Detached PHP Processes" button.
Contact Digital Analytix