Mac switch the default PHP version MAMP

Mac comes with PHP development environment, but many developers installed MAMP integrated environment, open the terminal and type: which php, will display / usr / bin / php, the system comes with PHP versions, to switch the default version of PHP MAMP under the PHP, bash_profile need to modify the system and execute the shell script.

Open a terminal input

1  1. sudo nano ~/.bash_profile
2 
3  2.PATH="/Applications/MAMP/bin/php/php5.6.2/bin:$PATH"
4 
5  export PATH

Then press Control + O to save, press Control + X to exit.

Do not forget to finish cut the following script

source .bash_profile

This time to enter: which php command is not switched under PHP version became the MAMP directory.

Guess you like

Origin www.cnblogs.com/zjj1990/p/11610953.html