PHP Mcrypt on Mac OS X 10.10.3

I have PHP 5.5.20 on my local machine running Mac OSX 10.10.3 and it's located at /usr/bin/php. I decided to use Laravel and saw that it depends upon a lot of things. The biggest issue was install Mcrypt for PHP.

This was solved by Machomebrew. Here's a simple procedure.

brew install mcrypt  
brew install homebrew/php/php55-mcrypt --without-hombrew-php  

This yields an interesting result once it's done

To finish installing mcrypt for PHP 5.5:  
  * /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini was created,
    do not forget to remove it upon extension removal.
  * Validate installation via one of the following methods:
  *
  * Using PHP from a webserver:
  * - Restart your webserver.
  * - Write a PHP page that calls "phpinfo();"
  * - Load it in a browser and look for the info on the mcrypt module.
  * - If you see it, you have been successful!
  *
  * Using PHP from the command line:
  * - Run "php -i" (command-line "phpinfo()")
  * - Look for the info on the mcrypt module.
  * - If you see it, you have been successful!

Obviously my php installation and config didn't yield anything when I did a php -i | grep "mcrypt". That's because the extensions wasn't registered with PHP. So, simply create a new php.ini (if it doesn't exist, if it does, just append to it.

sudo cp /etc/php.ini.default /etc/php.ini  
sudo su  
cat /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini >> /etc/php.ini  

Now, we just restart Apache.

sudo apachectl restart  

And boom mcrypt installed. Took a while, though.