How to Install mcrypt extension on cPanel/WHM server

How to Install mcrypt extension on server without control panel


 
Do the below steps to install mcrypt PHP extension on CentOS and RHEL servers.

1. Log into your Linux server via SSH as ‘root’ user

2. Install EPEL repository by running “yum install epel-release”

Edit epel.repo and change enabled=1

3. Check yum.conf and remove php* from yum exclude list (if you have added php in yum exclude list)

4. Run the command “yum -y install php-mcrypt” to install PHP mycrypt extension

5. Restart apache service using command : service httpd restart

Now Type the command “php -m | grep mcrypt” to check whether it is installed correctly. You can also check by creating a phpinfo page under the website.

[root@server ~]# php -m | grep mcrypt
mcrypt


 

How to Install mcrypt extension on cPanel Servers with Easyapache 4

On easyapache 4 servers you can use yum to install PHP extensions. You must have server root login details to install this PHP extension.

1. Log into cPanel server via SSH as root

2. Type the command “[root@server ~]# rpm -qa | grep mcrypt” to check whether Mcrypt is installed

[root@server ~]# rpm -qa | grep mcrypt
[root@server ~]#

The extension is not installed on the above server

3. Run the command “yum install ea-phpXX-php-mcrypt” to install Mcrypt

XX in the above command should be replaced with the correct PHP version.

Command to install Mcrypt for PHP 5.4 : yum install ea-php54-php-mcrypt
Command to install Mcrypt for PHP 5.5 : yum install ea-php55-php-mcrypt
Command to install Mcrypt for PHP 5.6 : yum install ea-php56-php-mcrypt
Command to install Mcrypt for PHP 7.0 : yum install ea-php70-php-mcrypt
Command to install Mcrypt for PHP 7.1 : yum install ea-php71-php-mcrypt

4. Type the below command to verify it is installed correctly

[root@server ~]# php -m | grep mcrypt
mcrypt

[root@server ~]# rpm -qa | grep mcrypt
ea-php56-php-mcrypt-5.6.30-1.1.3.cpanel.x86_64
ea-php71-php-mcrypt-7.1.1-1.1.2.cpanel.x86_64
ea-php55-php-mcrypt-5.5.38-8.8.10.cpanel.x86_64
ea-php70-php-mcrypt-7.0.15-1.1.3.cpanel.x86_64
ea-php54-php-mcrypt-5.4.45-26.26.10.cpanel.x86_64
 


How to Install mcrypt extension on cPanel Servers with Easyapache 3

On easyapache 3 servers you can install mcrypt extension either through server backend or through WHM

(I) Install Mcrypt through WHM :

1. Login to WHM using server root password

Link to access WHM : https://YourServerIP:2087

2. Search for “EasyApache 3” in WHM search bar on left

3. Click on “EasyApache 3” under “Software”

WHM Home » Software » EasyApache 3

4. Under “Exhaustive Options List” you must tick “Mcrypt”
 
PHP mcrypt easyapache
 
5. Click on “Save and Build”
 
(II)Enable mcrypt from server backend

1. Login to server via SSH as ‘root’

2. Run easyapache in screen

Command : screen -S easyapache

Easyapache might get stopped if your session gets disconnected. All the sites will be down if easyapache gets interrupted.

3. Run the command “/scripts/easyapache” to start easyapache

4. Under “Exhaustive Options List” you must select “Mcrypt”
 
Mcrypt easyapache 3 cPanel
 
5. Select “Save and build”

Create a phpinfo page under your domain to check whether “Mcrypt” extension is enabled.