How to install MCRYPT extension when using MAMP on OSX

Standard

  1. Go to Terminal
  2. Enter which php
    • If it says /usr/bin/php, then proceed to 3.
  3. Enter sudo nano ~/.bash_profile
  4. then paste this export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"
  5. ctrl - O then enter to save, then ctrl - X to exit.
  6. restart terminal.
  7. Enter which php
    • If you did it right, it should be the same as the path in #4.
Ref : http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension