https://www.jianshu.com/p/d080d06557be
更改環境變量來修改默認的php版本
新建一個.bas_profile文件並編輯
vim ~/.bash_profile
然后在里面輸入自己想要的php版本
export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH #/Applications/MAMP/bin/php/php7.2.7/bin是我的php版本路徑
保存重載環境變量
source ~/.bash_profile
以上沒解決問題
https://blog.csdn.net/hlllmr1314/article/details/52228672
按照如上修改了~/.bash_profile文件發現無效,並且提示 zsh: command not found: homestead 那么肯定是安裝了zsh的緣故,因為安裝zsh,~/.bash_profile就不會被執行,解決辦法如下:
1.打開vim ~/.zshrc 將你要配置到環境變量配置到該文件中即可
2.打開vim ~/.zshrc 添加source ~/.bash_profile ,這樣~/.bash_profile配置的環境變量同樣有效
