A recent request to install mcrypt for a payment module for Sagepay led me to put together this quick how-to based upon my CentOS Plesk 9.x webserver.

I used the following terminal command to find the exact mcrypt package name;

yum search "mcrypt"

Which returned the following

==================== Matched: mcrypt ====================
php-mcrypt.x86_64 : Standard PHP module provides...
php-mcrypt.i386 : Standard PHP module provides...

As I am running CentOS 64bit Linux core for my Plesk server, I require php-mcrypt.x86_64 for my installation.

yum install php-mcrypt.x86_64
service httpd restart

That about it, check your phpinfo to confirm that mcrypt is up and running!

Update : Had to install on a Plesk 10 server, here’s how I got it done:

Carrying out the usual yum install errors with the following

Error: php53-common conflicts with php-common

…so remembered I had not added the Atomic Repo on this server yet. As usual – Atomic to the rescue :

yum install php-mcrypt.x86_64

oaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* atomic: www7.atomicorp.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.x86_64 0:5.3.17-10.el5.art set to be updated
--> Processing Dependency: php-common = 5.3.17-10.el5.art for package: php-mcrypt
--> Running transaction check
---> Package php-common.x86_64 0:5.3.17-10.el5.art set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================================================
Package                                                   Arch                                                  Version                                                          Repository                                             Size
==============================================================================================================================================================================================================================================
Installing:
php-common                                                x86_64                                                5.3.17-10.el5.art                                                atomic                                                1.0 M
replacing  php53-common.x86_64 5.3.3-13.el5_8

php-mcrypt                                                x86_64                                                5.3.17-10.el5.art                                                atomic                                                 48 k

Transaction Summary
==============================================================================================================================================================================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing     : php-common                                                                                                                                                                                                             1/3
warning: /etc/php.ini created as /etc/php.ini.rpmnew
Installing     : php-mcrypt                                                                                                                                                                                                             2/3
Erasing        : php53-common                                                                                                                                                                                                           3/3

Installed:
php-common.x86_64 0:5.3.17-10.el5.art                                                                                 php-mcrypt.x86_64 0:5.3.17-10.el5.art

Replaced:
php53-common.x86_64 0:5.3.3-13.el5_8

Complete!