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

yum install -y libmcrypt-devel

To install the module with PHP 7.4, run

Advertisement

/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

PHP 7.4 mcrypt install

Back to Cpanel Server

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement