修改/etc/profile
文件:
运行命令:vim /etc/profile
在文件末尾加上如下两行代码
PATH=$PATH:/usr/local/php56/bin
export PATH
注意:如果添加多个用冒号(:)连接,例如:PATH=$PATH:/opt/remi/php73/root/bin
保存文件,执行 命令source /etc/profile
或 执行点命令 ./profile
使其修改生效,执行完可通过echo $PATH
命令查看是否添加成功