下载解压完nginx后,双击nginx.exe后访问http://127.0.0.1/,能够出现欢迎界面

但是在命令行关闭nginx服务时(nginx -s quit),报错nginx: [error] CreateFile() “D:\nginx-1.20.1/logs/nginx.pid” failed

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

解决办法:
在任务管理器强制关闭nginx进程,
然后再在命令行中重新用start nginx命令启动,
现在发现在nginx安装目录下的logs文件中出现了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.20.1/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: [error] CreateFile() “D:\nginx-1.21.6/logs/nginx.pid“ failed (2: The system cannot find the

    问题描述 nginx: [error] CreateFile() "D:\nginx\nginx-1.21.6\nginx-1.21.6/logs/nginx.pid" faile ...

  3. 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常 ...

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

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

  5. 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 ...

  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 ...

  10. nginx: [error] invalid PID number in /run/nginx.pid

    在重启云主机(系统)之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number "&q ...

最新文章

  1. Python 核心设计理念27个问题及解答
  2. php的yii简介,yii
  3. CodeForces616:Educational Round 5
  4. 尊重用户,提升产品欢迎度
  5. 阿里云业绩同比增126% 云服务现“3A鼎立”
  6. uva 550 有趣的乘法(dfs)
  7. oracle 多表视图更新
  8. reduce端的连接实现
  9. Windows 使用windump进行循环抓包
  10. Linux下利用ioctl函数获取网卡信息
  11. Java通过GeoLite2-City.mmdb进行IP信息查询地理定位和经纬度
  12. 白话大数据--Hash分片
  13. 支配树 / Dominator_Tree(待补)
  14. c语言中输入n一个整数存入一维数组,编写程序输入n个整数到一维数组(先输入数据的个数n,再输入n个数据),然后以输入的顺序输出这些数。...
  15. 甲骨文官网下载jdk历史版本
  16. 高等数学学习笔记——第八讲——数列极限的性质(2.数列极限的四则运算法则)
  17. 参考文献格式详细解释和引用(常见)
  18. UltraISO打开Ubuntu镜像ISO文件只有EFI文件夹
  19. 关于Java的位移运算
  20. 工业4.0中的人-信息-物理系统集成(HSI):设计与评估方法

热门文章

  1. Linux下把ncsi设置成OCP模式,一种测试网卡NCSI连接稳定性的方法及系统与流程
  2. 文件夹重命名导致软件图标不显示问题解决
  3. itertools.chain
  4. 使用python批量压缩图片文件
  5. windchill安装搭建(保姆式)
  6. C# 通过Http获取网页内容
  7. vue中使用海康插件实现视频监控-前端给视频画面中添加文字
  8. 求闰年的c语言程序函数,c语言闰年(闰年的算法c语言程序)
  9. OPNsense - 多功能高可靠易使用的防火墙(四)
  10. html怎么让音乐隐藏在网页中循环播放,怎么在网页中循环播放声音