第一步:编辑
vim /root/.bash_profile #给root用户配置
或者vim /etc/profile #给root用户配置
或者vim ~/.bash_profile # ~代表当前用户 等于 (/home/你的用户名)
全局配置(推荐)(后面步骤就不用执行了)
#ln -s 源文件 目标文件
ln -s /usr/local/php/bin/php /bin/php
第二步:在.bash_profile中编辑 在最后一行加入alias
export PATH #原有
alias php = /usr/local/php/bin/php #新增别名
第三步: 初始化文件,
source ~/.bash_profile
或者 . ~/.bash_profile
source /etc/profile