niginx command not found

xiaoxiao2021-02-27  670

centos 安装好nginx后修改了配置文件 nginx.conf,然后准备执行命令:

$:./nginx -s reload刷新配置文件的时候报错:  niginx command not found

解决:

类似windows添加环境变量一样,在.bash_profile  里面添加

.bash_profile   应该在/root  目录下,. 表示这是隐藏文件  用ls -a 可以查看

PATH=$PATH:/home/dev/share_dev/usr_local/nginx/sbin //*这里这个sbin路径是你自己的nginx的安装路径哦 export PATH

然后执行刷新:$ source .bash_profile

转载请注明原文地址: https://www.6miu.com/read-1941.html

最新回复(0)