Open a terminal and type php -v
to see the current version of php.
Determine the path for the wanted php version of mamp (YOUR VERSION ON YOUR COMPUTER!)
- example : /Applications/MAMP/bin/php/php5.x.x/bin/php
Type in the terminal cd ~
to change the current directory (in your home)
Then, type nano .bash_profile
to open an editor in your terminal
Type alias php='/Applications/MAMP/bin/php/php5.x.x/bin/php'
, don't forget to replace the php version
Now, you must save the file so press CTRL
+X
, then type Y
and finally type Enter
You must restart (stop && start || close && open) your terminal and type php -v
again
You now use the php version of mamp when you type php
in the terminal
Works like a charm, thanks a lot!