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.
Ensure that the libmcrypt extension is installed:
yum install libmcrypt
Install the EPEL repository:
yum install epel-release
Install the libmcrypt-devel package from the EPEL repository:
yum install libmcrypt-devel
Use PECL to install mcrypt:
/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:
- Login to WHM as the root user
- Navigate to: Home »Plugins »LiteSpeed Web Server Plugin
- Click the button that says "Restart Detached PHP Processes"