How to install PHP Mcrypt in CentOS 6?

After installing tools like phpMyAdmin on CentOS 6, sometimes you will see this error “The mcrypt extension is missing. Please check your PHP configuration”. This is due PHP mcrypt extension is missing and you have to install the extension.

As addition, the PHP module “Mcrypt” provides encryption and decryption using algorithms such as DES, TripleDES and Blowfish. You can read more about it on the official PHP Mcrypt page.


How to install PHP Mcrypt?
 

1. Login to SSH via Putty as root user
2. You will need EPEL repo to install php-mcrypt
     rpm -ivh http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 

3. Install PHP Mcrypt
    yum install php-mcrypt 

 4. Restart apache
    service httpd restart

 5. Perform update of the server
    yum update

6. You can also check to confirm that mcrypt has been installed
    php -m | grep -i mcrypt

Comments