For all enquiries please call or email us. 01484 506220info@designthatfits.co.uk

Magento - Installing Mcrypt on Centos6

Some magento payment gateways require PHP's Mcrypt library in order to work correctly, here's how you set it up in Centos6.

Jun 17, 2015

Some magento payment gateways require PHP's Mcrypt library in order to work correctly, here's how you set it up in Centos6.

We were migrating a Magento development website over to it's live environment the other day and came across the following errors when accessing a payment gateway:

Notice: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' in /lib/Varien/Crypt/Mcrypt.php on line 56

Notice: Use of undefined constant MCRYPT_MODE_ECB - assumed 'MCRYPT_MODE_ECB' in /lib/Varien/Crypt/Mcrypt.php on line 60

To fix this you need to install PHP Mcrypt. On Centos6 you can usually use the following command:

  • yum install php-mcrypt*

You may find that the EPEL repository doesn't contain the relevant install files, in which case you will have to add new repos that contain the php-mcrypt install as follows:

  • wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  • wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  • sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
  • yum update
  • yum install php-mcrypt*

And then finally, service httpd restart in order to restart your web server.

Return to articles
Fishpig's Wordpress extension was a key part of any magento 1.9.x project. This hasn't changed with Magento 2, but...
Marketing automation is a great asset for any business and once set up requires very little maintaining.
If you use plesk to run Magento 2 you might find difficulty when you come to run bin/magento commands
We'd suggest adding address lookup to the checkout.

Businesses can trust us to deliver effective online marketing solutions. Find out why.

Speak to an expert