How to set the default php version under mac: 1. Create a new [.bash_profile] file; 2. Set the default php version in the new file, such as [export PATH=/bin:$PATH]; 3 , execute the [source ~/.bash_profile] command.
Specific method:
(Recommended tutorial: php video tutorial)
Create a new one. bash_profile file and edit it
vim ~/.bash_profile
Then enter the php version you want inside
export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH #/Applications/MAMP/bin/php/php7.2.7/bin是我的php版本路径
Save and reload the environment variable
source ~/.bash_profile
Related recommendations:php training
The above is the detailed content of How to set the default php version on mac. For more information, please follow other related articles on the PHP Chinese website!