Introduction
The mcrypt extension has been deprecated by the developers of PHP so this extension is not available via cPanel's EasyApache. If at all possible, applications should instead make use of sodium or OpenSSL for encryption needs.
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 that you may attempt, but ultimately, cPanel cannot guarantee that 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-php72/root/usr/bin/pecl install mcrypt
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.