brew install php@7.4
vim ~/.bash_profile
//加入下面两行
export PATH=/usr/local/opt/php@7.4/bin:$PATH
export PATH=/usr/local/opt/php@7.4/sbin:$PATH
立即生效运行命令
source ~/.bash_profile
关闭终端再打开若出现没有生效的情况,可能没有在【zshrc】文件中写入变量信息
-
创建 zshrc
touch .zshrc
-
打开 zshrc
open -e .zshrc
-
在 zshrc 文件里输入 source ~/.bash_profile,然后保存
-
刷新环境
source .zshrc
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END