You can install the mcrypt PHP extension with homebrew
and use it with the standard PHP installation that comes with OS X.
Install mcrypt:
brew install mcrypt
Install the php extension -- this installs the whole php 5.5, but you can still use the system-provided one by default
Note: install the version compatible with whatever your OS X PHP version currently is (check with php -v
)
brew install homebrew/php/php55-mcrypt