Skip to Content

PHP extension ’mcrypt’ is required.

Installing php-mcrypt on a 64-bit CentOS Ezeelogin SSH Gateway Server


Synopsis: php-mcrypt is a PHP extension that provides encryption and decryption functions using the MCrypt library. PHP allows developers to encrypt and decrypt data using various encryption algorithms supported by MCrypt.


Follow the below steps to install in different versions of Cent OS and Ubuntu.

  • Centos 5.x (Deprecated)

:~# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

:~# rpm -ivh epel-release-5-4.noarch.rpm

:~# yum install php-mcrypt

  • Centos 6.x (Deprecated)

:~# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

:~# rpm -ivh epel-release-6-8.noarch.rpm

:~# yum install php-mcrypt

  • Centos 7.x

Install EPEL & php-mcrypt

:~# yum -y install epel-release

:~# yum -y install php-mcrypt

Follow the below steps if the above (EPEL) does not work in Centos 7.x

curl -o /tmp/epel-release-x.noarch.rpm http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

:~# rpm -Uvh /tmp/epel-release-x.noarch.rpm

:~# yum -y update; yum -y install php-mcrypt*; service httpd restart


  • Ubuntu 14.x  ( Replace PHP version with yours that has been installed in your server.)

:~# apt update && apt-get install php7.5-mcrypt && phpenmod mcrypt && systemctl restart apache2

  • Ubuntu 16.x 

:~# apt update && apt-get install php7-mcrypt &&  phpenmod mcrypt && systemctl restart apache2

  • Ubuntu 22

:~# apt update && sudo apt install php7.4-mcrypt -y && sudo phpenmod mcrypt && systemctl restart apache2


Related Articles:

Switch PHP versions

Install Ioncube