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 make use of 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 extension:
yum install libmcrypt
- Install the EPEL repository:
yum install epel-release
- Install the libmcrypt-devel package from the EPEL repository:
yum install libmcrypt-devel
- 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.