In an earlier post, Installing Multiple Versions of PHP on Mac OS X with Homebrew-PHP, I mentioned using Homebrew-PHP to install multiple versions of PHP. I ran into an issue installing Magento due to the mcrypt extension not being loaded.
PHP extension “mcrypt” must be loaded.
Note: I’m assuming here that you have already checked your php.ini file and uncommented the appropriate line that loads the mcrypt extension.
Using Homebrew, it’s a simple process to get mcrypt added to PHP.
First, tap (which may be unnecessary if you used Homebrew-PHP):
$ brew tap josegonzalez/php
And then do the install:
$ brew install PHP53-mcrypt
This also works with PHP 5.4 (PHP54-mcrypt) and PHP 5.5 (PHP55-mcrypt).
You may be prompted to link:
Error: You must `brew link php53' before php53-mcrypt can be installed
You may also get another error, something like:
Error: Could not symlink file: /usr/local/Cellar/php53/5.3.26/bin/phpize
Target /usr/local/bin/phpize already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
To list all files that would be deleted:
brew link --overwrite --dry-run formula_name
I didn’t have any issues with this and simply ran:
$ brew link --overwrite php53
If you get an error about not having zlib installed, they try:
$ brew tap homebrew/dupes
Restart Apache and with a little bit of luck you should have mcrypt loaded.