Nginx系列(6)- nginx: [error] CreateFile() "D:\nginx-1.20.1/logs/nginx.pid" failed (2: The system cannot find the file specified)
背景
修改nginx配置文件nginx.conf后,想要重启nginx使配置生效。cmd进入nginx安装目录,输入命令: nginx -s reload
报错:nginx: [error] CreateFile() "D:\nginx-1.20.1/logs/nginx.pid" failed (2: The system cannot find the file specified)
原因分析
- 问题的直接原因就是在nginx的安装目录下的logs目录里面没有nginx.pid这个文件,一般情况下nginx启动时会自动创建nginx.pid文件的
- nginx启动或者重启需要杀掉原来的nginx进程,需要根据nginx.pid找到原来的进程,其中pid其实就是原来的进程ID了
- 出现这种情况的原因可能是nginx未启动或者nginx.pid被手动删除掉,有时候在windows系统通过双击方式启动nginx会有无法在logs目录下自动生成nginx.pid文件的情况
- 在没有启动nginx的情况下(以及你不清楚有没有启动),不要使用nginx -s reload命令来作为启动命令,可以避免这个报错发生
解决方法
1.任务管理器里面找到原来的nginx进程(如果有的话)并关掉,然后使用cmd命令的方式启动nginx 2.cmd 进入 nginx安装目录 3.输入命令 start nginx 或者 nginx.exe 启动nginx 4.去nginx目录下logs目录下看看有没有nginx.pid的文件;如果没有重复123操作 5.如果nginx.pid已经生成,再去修改配置文件后就可以正常重启了 6.nginx -s reload
Nginx系列(6)- nginx: [error] CreateFile() "D:\nginx-1.20.1/logs/nginx.pid" failed (2: The system cannot find the file specified)的更多相关文章
- nginx报错[error] CreateFile() "D:\Java-windows\nginx-1.16.0/logs/nginx.pid" failed (2: The system cannot find the file specified)
无论是nginx -s stop还是nginx -s reload命令,都会出现这个错误. 解决方法:使用命令创建/logs/nginx.pid文件,命令如下所示: nginx -c conf/ngi ...
- Nginx错误:nginx: [error] OpenEvent("Global\ngx_reload_6252") failed (2: The system cannot find the file specified)
执行nginx -s reload命令: nginx: [error] OpenEvent("Global\ngx_reload_6252") failed (2: The sys ...
- nginx错误: [error] OpenEvent("Global\ngx_reload_10444") failed (2: The system cannot find the file specified)
执行nginx -s reload命令: nginx: [error] OpenEvent("Global\ngx_reload_10444") failed (2: The sy ...
- Nginx报错 nginx: [error] open() "/usr/local/nginx-1.6.3/logs/nginx.pid" failed (2: No such file or directory)
问题: 解决: http://www.jianshu.com/p/918eb337a206 dd
- Nginx系列(4)- Nginx安装 | Windows
下载 访问官网,选择稳定版对应的Windows系列 安装解压即可 启动nginx 有很多种方法启动nginx 直接双击nginx.exe,双击后一个黑色的弹窗一闪而过 打开cmd命令窗口,切换到ngi ...
- Windows下nginx报错解决:CreateFile() "xxx/logs/nginx.pid" failed
写在前面 本文给出Windows下nginx报错:CreateFile() "xxx/logs/nginx.pid" failed 的解决方法并分析了出错原因,其中 xxx 表示n ...
- 解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误
重新启动服务器,访问web服务发现无法浏览,登陆服务器之 后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr ...
- nginx ../logs/nginx.pid" failed (2: No such file or directory)
[1]nginx.pid相关 (1)可能出现两种场景: 1.1 nginx.pid文件不存在 发生现象:nginx: [error] open() "/usr/local/lib/ubcsr ...
- nginx: [error] CreateFile() "E:\nginx\nginx-1.9.3/logs/nginx.pid" failed
nginx: [error] CreateFile() "E:\nginx\nginx-1.9.3/logs/nginx.pid" failed nginx: [error] Op ...
随机推荐
- 在C#中使用C++编写的类——用托管C++进行封装
现在在Windows下的应用程序开发,VS.Net占据了绝大多数的份额.因此很多以前搞VC++开发的人都转向用更强大的VS.Net.在这种情况下,有很多开发人员就面临了如何在C#中使用C++开发好的类 ...
- Spring详解------概述
1.什么是 Spring ? Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One J2E ...
- mzy git学习,禁用Fast forward的普通合并(六)
git merge --no-ff -m "msg" x-branch:禁用Fast forward的普通合并 通常,合并分支时,如果可能,Git会用Fast forward模式, ...
- jQuery中的基本过滤选择器(四、三)::first、:last、:not() ... ...
<!DOCTYPE html> <html> <head> <title>基本过滤选择器</title> <meta http-equ ...
- 编辑器扩展 --- 自动化处理之AssetPostprocessor资源导入
AssetPostprocessor资源导入管线 AssetPostprocessor用于在资源导入时自动做一些设置,比如当导入大量图片时,自动设置图片的类型,大小等.AssetPostprocess ...
- Go依赖包管理--间接依赖
目录 1.indirect含义 1.2 直接依赖未启用 Go module 1.2 直接依赖 go.mod 文件不完整 2.总结 1.indirect含义 在使用 Go module 过程中,随着引入 ...
- ES6对象扩展——扩展运算符
1.复制对象:使用扩展运算符复制对象时是浅拷贝 //复制对象:使用扩展运算符复制对象时是浅拷贝 const obj1 = { a:1, b:2, d:{ aa:1, bb:2 } } const ob ...
- Learning ROS: Roslaunch tips for large projects
Design tip: Top-level launch files should be short, and consist of include's to other files correspo ...
- jmeter实际场景应用之测试上传excel文件
日常工作上测试的时候,会有一些场景是导入/上传文件.我们系统多是excel文件,这里就用excel文件为例,详述一下此次测试遇到的坑.最终结果是成功的,请看到最后! 1.获取接口的一些参数信息 先按F ...
- Core3.1WebApi使用MongoDB
好久没有使用MongoDB了,重新测试使用,版本不一样之前很多方法都使用不了了,下面为部分测试,下次再来更新测试 测试中使用的命令 // 新增读写的用户 db.createUser({ user:'f ...