nginx: [error] CreateFile() "D:\software\nginx/logs/nginx.pid" failed (2: The system cannot find the file specified)

D:\software\nginx>nginx -s stop
nginx: [error] CreateFile() "D:\software\nginx/logs/nginx.pid" failed (2: The system cannot find the file specified)

  • 造成这个报错的主要原因是在没有启动nginx的情况下执行了stop或reload命令;这时我们可以使用

    nginx -t
    

    查看运行情况;

D:\software\nginx>nginx -t
nginx: the configuration file D:\software\nginx/conf/nginx.conf syntax is ok
nginx: [emerg] CreateDirectory() "C:/Users/99043/Pictures/yunong/" failed (3: The system cannot find the path specified)
nginx: configuration file D:\software\nginx/conf/nginx.conf test failed

  • 发现是路径的问题,修改后再次查看:

D:\software\nginx>nginx -t
nginx: the configuration file D:\software\nginx/conf/nginx.conf syntax is ok
nginx: configuration file D:\software\nginx/conf/nginx.conf test is successful

posted @ 2021-09-14 10:06  小白酒菊  阅读(2982)  评论(0)    收藏  举报