linux上php配置全局

来源:互联网 发布:unity3d itweenpath 编辑:程序博客网 时间:2024/06/11 21:40

在开发过程中、需要使用到PHP命令执行程序、但是php命令没有在全局命令中;每次执行都需要加上全路径特别麻烦,下面介绍一种方式,把php命令添加到全局变量中,以后每次只用输入php可以了


编辑/etc/profile文件

在最后一行加入

[html] view plain copy print?
  1. PATH=$PAHT:/usr/server/php/bin  

保存退出

然后执行

[html] view plain copy print?
  1. source /etc/profile  


就可以在Linux下任意地方执行php命令了

执行

[html] view plain copy print?
  1. php -v    
查看php的版本号
原创粉丝点击