How to install PHP 7.4 mcrypt module in Cpanel Server
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
1 |
yum install -y libmcrypt-devel |
To install the module with PHP 7.4, run
1 |
/opt/cpanel/ea-php74/root/bin/pecl install mcrypt-1.0.5 |
After installation, you can verify from command line with
1 2 3 |
# /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
1 2 |
/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