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