-bash: nginx: command not found 解决方案

在启动nginx时,报错误, nginx 未找到此命令

安装的linux版本为centos 7.2

经在网上查询后,找到答案,记录一下以后备查

需要把nginx所在的目录加入系统变量中

vi /etc/profile

在文件最后中添加

PATH=$PATH:/var/local/nginx/sbin

export PATH

保存并退出

执行source /etc/profile 使配置文件生效后,即可.

猜你喜欢

转载自www.cnblogs.com/ithw/p/10446930.html