I installed php on my Mac using Macports
. I guess, at this early stage in my Mac experience, that it's the equivalent of APT on Debian-based systems. It installed without a hitch, and php was up and running.
But when I began installing a web app that required mcrypt, I noticed some problems. I used the 'port' command again to install the mcrypt package. Once again, no errors reported. But the web app (Magento) continued to complain that the "PHP extension 'mcrypt' must be loaded."