[nginx报错问题]reload时报错:nginx: [error] invalid PID number "" in ...
错误
第一次探索nginx,执行以下命令时:
nginx -s reload
报出错误:

nginx: [error] invalid PID number "" in ...
*此时忽略掉了warn警告信息
排查
Step 1
baidu搜索了一众文章,大都是说执行:
nginx -c /etc/nginx/nginx.conf
*地址改成自己的(如,win10下,F:\install\nginx-1.16.1\logs\nginx.conf)
参考例:
- nginx: [error] invalid PID number "" in ...
- Nginx报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决方法
而执行之后并没有解决
Step 2
执行 nginx -t 查看测试结果
发现 80 端口被占用的问题:

我们都知道,windows 10 上的 IIS 默认站点的默认端口即 80,
而我将它改为了 808,所以,
此时 80 端口占用问题,应该跟 IIS 没有关系。
Step 3
找到该问题一致的文章:
Nginx 错误10013: An attempt was made to access a socket in a way forbidden
方案是:
- 找到占用该端口(80)的 PID(进程ID),
- 在任务管理器中找到这个 PID 的进程,kill终止它
但是,不同的是,
netstat -aon | findstr ":80"
查找到的 80 端口占用 PID 为 4,
任务管理器中PID=4的进程为System,
也就是说,不能终止进程,方案行不通。
*并不是一个可以终止的进程,右键终止是不可用的状态
解决
最终解决是因为找到了【泡泡虾】的文章:
80端口被system占用解决过程
虽然该作者并不是在使用 nginx 的时候遇到的问题,
但本质和解决方法是一样的。
即:
开始菜单 -> services.msc -> 找到SQL Server Reporting Services`服务 -> 停止掉
- Service名:
ReportServer - 显示名:
SQL Server Reporting Services (MSSQLSERVER)
此时,再检查一下端口情况 netstat -aon | findstr ":80" :
已经没有 80 端口了。
执行nginx -t测试结果也通过了(successful)

但是,nginx -s reload还是一开始的错误,并没有解决。
再次启动nginx:
start nginx.exe
OK~

[nginx报错问题]reload时报错:nginx: [error] invalid PID number "" in ...的更多相关文章
- nginx重启报错:nginx: [error] invalid PID number "" in "/run/nginx.pid"
问题描述:执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/run/ngin ...
- Centos7.5中Nginx报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决方法
服务器重启之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number "" ...
- nginx: [error] invalid PID number "" in "/run/nginx.pid"
在重启云主机(系统)之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/ ...
- nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"
iwangzheng.com tty:[0] jobs:[0] cwd:[/opt/nginx/conf] 12:45 [root@a02.cmsapi]$ /usr/local/nginx/sbin ...
- nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”
在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误: nginx: [error] invalid PID number "" in " ...
- 解决 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"
使用/usr/local/nginx/sbin/nginx -s reload 重新读取配置文件出错 [root@localhost nginx]/usr/local/nginx/sbin/nginx ...
- nginx: [error] invalid PID number "" in "/usr/local/webserver/nginx/logs/nginx.pid" (原)
进入nginx文件下,例如 :/usr/local/nginx/sbin [root@iZ25f7emo7cZ /]# cd /usr/local/nginx/sbin 运行命令: [root@iZ2 ...
- nginxUbuntu安装Nginx和正确卸载Nginx Nginx相关 与Nginx报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决方法
https://www.cnblogs.com/zhaoyingjie/p/6840616.html https://blog.csdn.net/adley_app/article/details/7 ...
- nginx: [error] invalid PID number "" in ...
1.查看进程 ps -ef|grep nginx 2.进入nginx安装目录sbin下,执行命令: ./nginx -t 如下显示: syntax is ok test is successful 3 ...
随机推荐
- 字符串后面空字符的问题(char*与string的转换)
今天AC了不少题,困扰已久的Time limit error 也解决了,记住下次用STL容器的时候一定要清空容器. 其次是字符数组与字符串的浅谈. 字符数组是以'\0'结尾的,所以在字符数组赋值给字符 ...
- 洛谷P1217 回文质数
题目描述 因为 151 既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数. 写一个程序来找出范围 [a,b] (5 \le a < b \le 100,000 ...
- P1465 序言页码 Preface Numbering (手推)
题目描述 一类书的序言是以罗马数字标页码的.传统罗马数字用单个字母表示特定的数值,以下是标准数字表: I 1 V 5 X 10 L 50 C 100 D 500 M 1000 最多3个同样的可以表示为 ...
- [CodeForces-259C] Little Elephant and Bits
C. Little Elephant and Bits time limit per test 2 seconds memory limit per test 256 megabytes input ...
- python(json 模块)
1.Json 定义 定义:JSON(JavaScript Object Notation, JS 对象简谱) 是一种轻量级的数据交换格式.JSON 的数据格式其实就是 python 里面的字典格式,里 ...
- spark系列-3、缓存、共享变量
一.persist 和 unpersist 1.1.persist() : 用来设置RDD的存储级别 存储级别 意义 MEMORY_ONLY 将RDD作为反序列化的的对象存储JVM中.如果RDD不能 ...
- 不需要爬虫也能轻松获取 unsplash 上的图片
我经常会使用 unsplash, 这里面的图片非常清爽,我的大多数文章的图片都是在这个网上找的,虽然也有同类型网站,但是用过一段时间以后基本都放弃了,图片质量参差不齐,筛选过程太费劲. 但是 unsp ...
- Spring官网阅读(九)Spring中Bean的生命周期(上)
文章目录 生命周期回调 1.Bean初始化回调 2.Bean销毁回调 3.配置默认的初始化及销毁方法 4.执行顺序 5.容器启动或停止回调 Lifecycle 接口 LifecycleProcesso ...
- Ubuntu系统make menuconfig的依赖包ncurses安装
Linux内核或者u-boot进行make menuconfig的时候,如果系统上没有安装ncurses,就会出现以下报错 *** Unable to find the ncurses librari ...
- [codeforces-543B]bfs求最短路
题意:给一个边长为1的无向图,求删去最多的边使得从a到b距离<=f,从c到d距离<=g,a,b,c,d,f,g都是给定的,求最多删去的边数. 思路:反过来思考,用最少的边构造两条从a到b, ...