mac添加环境变量以及顺序问题

/etc/profile    /etc/paths    ~/.bash_profile    ~/.bash_login    ~/.profile    ~/.bashrc

特别注意

/etc/paths中的内容:

/usr/bin

/bin

/usr/sbin

/sbin

/usr/local/bin

Homebrew安装的软件,其二进制执行文件都放在/usr/local/bin中,bin在使用时的查找不是覆盖原则,而是优先查找

具体操作如下:

首先echo $PATH


vim ~/.bash_profile

添加一行

export PATH=/usr/local/Cellar/php56/5.6.33_9/bin:$PATH

意思就是,在目前的环境变量前拼接/usr/local/Cellar/php56/5.6.33_9/bin:

执行source ~/.bash_profile

echo $PATH

注意 :

~/.bash_profile 文件mac每次启动运行一次,所以要配置好并且注意顺序

你可能感兴趣的:(mac添加环境变量以及顺序问题)