[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 ...
随机推荐
- 从零搭建Prometheus监控报警系统
什么是Prometheus? Prometheus是由SoundCloud开发的开源监控报警系统和时序列数据库(TSDB).Prometheus使用Go语言开发,是Google BorgMon监控系统 ...
- 图论--2-SAT--poj 3678-Katu Puzzle(模板题)
Description Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a ...
- HDU - 1253 胜利大逃亡(搜索)
Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会. 魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在( ...
- 怎么避免写出慢SQL
在大多数实际的系统中,慢 SQL 消耗掉的数据库资源,往往是正常 SQL 的几倍.几十倍甚至几百倍. 怎样才能在开发阶段尽量避免写出慢 SQL 呢? 估算数据量 慢 SQL 对数据库的影响,是一个量变 ...
- 网络流中的图像转化为OpenCV中的Mat类型
1,从网络中读取到的图像流,不支持查找,不能直接转化为Mat类型 2,例子如下: string Url = "http://192.168.0.110/cgi-bin/camera?reso ...
- 纯django开发最完美博客
2020年5月打造最时尚博客系统教程 为了学习速度,集中精力学习django和博客开发, 没有使用其它框架,也没有使用css预处理等 这样学起来最方便, 博客前后端都完成, www.duanshuil ...
- 进程间通信之socketpair
socketpair是进程间通信的一种方式. API: ]); DEMO: #include <stdio.h> #include <stdlib.h> #include &l ...
- SSTI(服务器模板注入)学习
SSTI(服务器模板注入)学习 0x01 SSTI概念 SSTI看到ss两个字母就会想到服务器,常见的还有SSRF(服务器端请求伪造).SSTI就是服务器端模板注入(Server-Side Templ ...
- opencv基于PCA降维算法的人脸识别
opencv基于PCA降维算法的人脸识别(att_faces) 一.数据提取与处理 # 导入所需模块 import matplotlib.pyplot as plt import numpy as n ...
- Eating Everything Efficiently(反向dp)
传送门 取最大值即可.用拓扑,dfs都可以实现 #include <bits/stdc++.h> using namespace std; const int maxn=500009; i ...