There are various threads about this issue happening with earlier versions of MAMP, but most of those threads are dated back to 2014 and now it's 2016 with MAMP Pro having version 4.
I need Mcrypt for a legacy codebase / framework. With MAMP Pro 4 you can change PHP version per host. In this instance I'm running 5.5.38.
Framework outputs just text "Mcrypt PHP extension required." – and when using phpinfo() it's clear that Mcrypt is not loaded as there is no section for Mcrypt but this is listed under Configure Command:
--with-mcrypt=shared,/Applications/MAMP/Library'
On MAMP Pro 4 under File > Edit Template > PHP (php.ini) > 5.5.38 there is this line:
extension=mcrypt.so
So everything seems to be in order and clearly they have intended it to work out-of-the-box – or after an version upgrade, as in my case MAMP Pro 3.4 > 4.0.6.
But why doesn't this work?
NOTE! This problem is not with CLI PHP, but Apache's host PHP.
It seems they have messed up with PHP ini files before (2y ago), resulting in a similar problem, promising to deliver a fix soon: Mcrypt with Mamp Pro on Mac OS X Yosemite 10.10
Additional info:
MacOS 10.11.6 El Capitan
which mcrypt
/usr/local/bin/mcrypt
locate mcrypt.ini
/usr/local/etc/php/5.4/conf.d/ext-mcrypt.ini
/usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini