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.

DTF Digital