方法三(对所有系统所有 用户生效,永久生效) 修改 /etc/profile 文件,在文件末尾加上如下两行代码 PATH=$PATH:/usr/local/PHP/bin export PATH 最后执行命令 source /etc/profile 或执行点命令 ./profile 使其修改生效