Michael Gracie

Plugging mcrypt into PHP, on Mac OS X El Capitan 10.11

We made our way into the park. Now we do some climbing.

The following instructions are for those a) developing on OS X El Capitan 10.11.X, b) need mcrypt for their PHP development (think PHPMyAdmin, Magento eCommerce or just twisting _RIJNDAEL_256 for shits and giggles), and c) are unwilling to recompile PHP from scratch or run an alternative development package set such as MAMP. Mcrypt will load dynamically with PHP by venturing forth.

Before beginning acquire the following stuff …

1) libmcrypt-2.5.8, which you can find here; download by clicking the one of the two file links (author used “libmcrypt-2.5.8.tar.gz”);

2) PHP 5.5.27 source code, which is available here; [NOTE: you may someday update OS X beyond 10.11, and PHP may get updated along with it; the author used 10.11, and PHP 5.5.27 was included with that OS version. If necessary use php -v to check your version of PHP and then download the PHP source for that version.];

3) Xcode 7.0.1, which you can get from the App Store. You will also need the Command Line Tools (OS X 10.11) for XCode, which you get by selecting “Xcode/Open Developer Tool/More Developer Tools…” from the Xcode menu, then logging into your Apple Developer account (and if you don’t have one of those, get one); and

4) Homebrew ( which can be installed by typing ruby -e "$(curl -fsSL install/master/install)" at the command line.

Now we get down to business …