问题描述

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

执行命令 start nginx 启动 nginx 后 ,nginx -s quit 报错

一开始执行一次 nginx -s quit 未报错 , 但是 启动的服务还没有关闭 ,后面再次执行,报错



根据报错信息来看,在 nginx 安装目录下的 logs文件中找不到 nginx.pid 文件,去对应文件查看,发现确实没有该文件


解决办法

在任务管理器强制关闭nginx进程 (快捷键:Ctrl + shift + Esc )


刷新页面后,无法访问


再重新 执行命令  start nginx 启动 服务


现在发现在 刚才报错的目录下多出了 nginx.pid 文件


再用命令 nginx -s quit ,正常关闭 nginx 进程


刷新页面 无法访问  http://127.0.0.1/,成功关闭 nginx


原因分析

nginx 在启动或重启时要杀掉之前的 nginx 进程,就需要通过 nginx.pid 来找到原来的进程,而 nginx.pid 存储的就是原来的进程 id 。没有进程id系统就无法找到原来的 nginx 进程,自然就无法关闭了

之后测试无论是双击 nginx.exe 还是 cmd 命令启动 nginx,都会自动在 logs 文件下配置nginx.pid 文件,均可正常关闭


文章如有错误,恳请大家提出问题,本人不胜感激 。 不懂的地方可以评论,我都会 一 一 回复

文章对大家有帮助的话,希望大家能动手点赞鼓励,大家未来一起努力     长路漫漫,道阻且长

nginx: [error] CreateFile() “D:\nginx-1.21.6/logs/nginx.pid“ failed (2: The system cannot find the相关推荐

  1. nginx: [emerg] CreateFile() “D:\soft\nginx-1.18.0/logs/nginx.pid“ failed (5: Access is denied)

    win10启动nginx报错 nginx: [emerg] CreateFile() "D:\soft\nginx-1.18.0/logs/nginx.pid" failed (5 ...

  2. nginx.pid failed (2: The system cannot find the file specified

    nginx.pid" failed (2: The system cannot find the file specified nginx -c conf/nginx.conf nginx常 ...

  3. Windows:nginx: [error] CreateFile() “/logs/nginx.pid“ failed (2: The system)

    先看下报错信息 这是我Nginx的第一个小坑,其实这个也算不上坑,就是不知道Nginx的加载规则. 原因:你的Nginx并未启动,所以无法加载配置文件 解决方案: 第一步:你需要先启动你的Nginx( ...

  4. Nginx报错:nginx: [emerg] CreateFile() nginx.conf“ failed (3: The system cannot find the path specified

    windows下启动nginx报错: nginx: [emerg] CreateFile() "D:\桌面\nginx-1.12.0/conf/nginx.conf" failed ...

  5. zabbix nginx error log监控

    自定义key值,匹配1分钟前nginx error log出现的次数. nginx_error_log的日志格式: 2016/12/05 21:01:29 [error] 13672#0: *4408 ...

  6. windows安装nginx莫名其妙 CreateFile()权限不够创建问题

    报错: C:\Users\Administrator>nginx nginx: [alert] could not open error log file: CreateFile() " ...

  7. nginx报错:nginx: [alert] could not open error log file: open() “/var/log/nginx/error.log“ failed (2: N

    参考文章1:nginx error_log 错误日志配置说明 如图,启动nginx时报错: [root@RV1126_RV1109:/usr/sbin]# nginx -c /etc/nginx/ng ...

  8. 解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误

    [root@localhost sbin]# ./nginx -s reload nginx: [error] open() "/usr/local/nginx/logs/nginx.pid ...

  9. 解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

    解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid 重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./ng ...

最新文章

  1. 【原创】modb 功能设计之“跨线程通信”
  2. 初玩PLSQL连接 Oracle
  3. springboot ---- sts如何启动两个实例
  4. windows和linux没有启动选择,重装Windows后,LILO启动选单不见了,无法进入Linux系统怎么办...
  5. 计算机应用与软件修审,国中课室素养导向标准本位评量的设计与应用:以英语科阅读为例...
  6. 新浪微博开发者平台应用申请及配置说明
  7. 印度人为什么立刀切菜_印度人如何用菜刀,为什么是菜刀不动食材动,与中国完全相反...
  8. Flixel Dame 坦克大战(二)Dame-editor使用指南
  9. 如何用 SSH 登录 Kindle 系统
  10. 形象解释清了内存颗粒、单双面、主板布线和双通道的那些事儿
  11. 调用本地主干的预训练的.pth文件
  12. MySQL源代码的海洋中游弋 初探MySQL之SQL执行过程 [转]
  13. 软件测试方法和技术第一章——引论
  14. SecurityConfig+TokenConfig+Oauth2Config--CureGuy
  15. Git如何查看本地已登录的用户账号及切换账号
  16. 笔记--javascript对象及简单,复杂数据类型
  17. 行业分析:是什么,为什么要做,怎么做好
  18. REPAIR TABLE导致死锁
  19. android hook 多线程,从零编写Android Hook Framework
  20. G Suit 介绍

热门文章

  1. 环保性能高的家装乳胶漆怎么选择
  2. Mac电脑-mysql密码忘了怎么处理
  3. Word embeddings-词向量
  4. Linux: 关于 SIGCHLD 的更多细节
  5. Oracle求同比SQL
  6. 一个研发管理使命、愿景、价值观的案例
  7. 手淘双十一性能优化项目揭秘
  8. Windows10版本即将终止服务请立即重启
  9. 服务器虚拟化技术主要有什么优势
  10. 17 个 JVM 参数