mcrypt is a PHP module, that was DEPRECATED in PHP 7.1.0, and REMOVED in PHP 7.2.0. mcrypt is removed from PHP, now it is available as a PECL module at
https://pecl.php.net/package/mcrypt
To install mcrypt on Cpanel Server, first, install libmcrypt-devel package with yum
yum install -y libmcrypt-devel
To install the module with PHP 7.4, run
/opt/cpanel/ea-php74/root/bin/pecl install mcrypt-1.0.5
After installation, you can verify from command line with
# /opt/cpanel/ea-php74/root/bin/php -m | grep mcrypt mcrypt #
If you want to install with another PHP version, change ea-php74 with your PHP version.
After installing, restart Apache and php-fpm service
/scripts/restartsrv_apache /scripts/restartsrv_apache_php_fpm
To verify, create a phpinfo() file on your website. Go to the URL, and search for mcrypt on the page. You will see
Back to Cpanel Server