I currently have working copy of Magento installed on my machine. I am now trying to install another copy. The new install has thrown the error

PHP extension "mcrypt" must be loaded.

I can only assume that it is looking at a different file to what the other install is looking at.

How do I find where the working install is looking?


Comparing the two I can see the working one has local.xml in app/etc folder and the new install does not, is this automatically created on the install? I assume I can't copy and paste it due to this line of code

<crypt> <key><![CDATA[89a7677964ad4d3e338b9ca5978f9ad5]]></key> </crypt>


In both installed version and version im trying to install echo phpinfo() showed mcrypt was not being used and shows

Configuration File (php.ini) Path /etc

this is different to the file path shown in the next command I made

so I ran php --ini on the cli and it displayed this

myName@myMac:~ » php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/5.4
Loaded Configuration File:         /usr/local/etc/php/5.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.4/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.4/conf.d/ext-ioncubeloader.ini,

It seems there are two php installs how would I point my currently install copy of Magento to use the correct one and how would I tell the new install to look in that folder? or should I simply drag files from






Checking for installed PHP extensions happens only during installation, that's why you don't get the error message in the working copy.

I strongly recommend to install the PHP extension, otherwise the encryption methods in Magento will not work. If you check the PHP error logs or enable developer mode, you probably see lots of errors because of the missing extension.

That being said, you can create the local.xml file manually or copy it from the other installation instead of using the setup routine. On a fresh database you can choose any hash value as encryption key (the setup routine allows you to enter it or creates it randomly for you)

  • My trouble is that for the previous install I ran the magento check and had no install suggestions. Between then and now I had an issue which was resolved by someone else but left me having to go into app/etc/local.xml and change <host><![CDATA[localhost]]></host> to to have the original install work. I am now left wondering are there multiple installs of php on my computer and if so I don't want to delete the wrong install. – tony09uk Feb 18 '14 at 11:40
  • 1
    To verify this, you can add a file info.php with the following content to both installations: <?php phpinfo();, then open it in the browser and search for "mcrypt" and "loaded configuration file", if there is in fact a difference. – Fabian Schmengler Feb 18 '14 at 11:44
  • I have now ran brew install php54-mcrypt and got the following message php54-mcrypt-5.4.23 already installed but running phpinfo on my installed version does not show any reference to mcrypt – tony09uk Feb 18 '14 at 12:11
  • That's why you should check the loaded configuration file as well. Your php.ini file or any additional loaded configuration file should contain the line extension=mcrypt.so to enable the extension. – Fabian Schmengler Feb 18 '14 at 12:39
  • please see edit, I think I have done as you suggested, but it has brought forward another question – tony09uk Feb 18 '14 at 13:42

Here is the solution mcrypt error for PHP 7.2 + versions In Xampp, wamp, etc Just follow the below link and download ext in the "Dell List" section. like 7.4 Thread Safe (TS) x64 Ext solution package for window Unzip file and paste both (php_mcrypt.pdb, php_mcrypt.dll) files in PHP>ext folder. Next Edit php.ini file and add


below "; Dynamic Extensions". Restart apache, it's work like cream.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.