Last Updated: February 25, 2016
·
780
· ashwinr

Using Your MAMP PHP version in bash

Have you ever wanted to use your PHP installation from MAMP on a Mac?
I like to keep my original PHP version separated from the MAMP version. Here's how:

alias mamphp="/applications/mamp/bin/php/php5.4.4/bin/php "

What this does is it creates an alias which leads to the path of my v5.4.4 install of PHP in MAMP.

Now, I can use "mamphp" as if it were a command and use MAMP's installation as if it were my own. This is handy, for example, if I wanted to use Laravel,which requires the Mcrypt library, which conveniently happens to be in the MAMP installation.