错误

第一次探索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)

参考例:

而执行之后并没有解决


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 ...的更多相关文章

  1. nginx重启报错:nginx: [error] invalid PID number "" in "/run/nginx.pid"

    问题描述:执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/run/ngin ...

  2. Centos7.5中Nginx报错:nginx: [error] invalid PID number "" in "/run/nginx.pid" 解决方法

    服务器重启之后,执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number "" ...

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

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

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

  5. nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”

    在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误: nginx: [error] invalid PID number "" in " ...

  6. 解决 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 ...

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

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

  9. nginx: [error] invalid PID number "" in ...

    1.查看进程 ps -ef|grep nginx 2.进入nginx安装目录sbin下,执行命令: ./nginx -t 如下显示: syntax is ok test is successful 3 ...

随机推荐

  1. DP 60题 -2 HDU1025 Constructing Roads In JGShining's Kingdom

    Problem Description JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which ...

  2. 一只简单的网络爬虫(基于linux C/C++)————利用正则表达式解析页面

    我们向一个HTTP的服务器发送HTTP的请求后,服务器会返回可能一个HTML页面(当然也可以是其他的资源),我们可以利用返回的HTML页面,在其中寻找其他的Url,例如我们可以这样在浏览器上查看一下H ...

  3. 数据结构与算法:栈(Stack)的实现

    栈在程序设计当中是一个十分常见的数据结构,它就相当于一个瓶子,可以往里面装入各种元素,最先装进这个瓶子里的元素,要把后装进这个瓶子里的全部元素拿出来完之后才能够把他给拿出来.假设这个瓶子在桌上平放,左 ...

  4. Spring Cloud 学习 之 Spring Cloud Eureka(搭建)

    Spring Boot版本:2.1.4.RELEASE Spring Cloud版本:Greenwich.SR1 文章目录 搭建服务注册中心: 注册服务提供者: 高可用注册中心: 搭建服务注册中心: ...

  5. 一文教你快速搞懂 FOC ramp function 斜坡函数的作用和实现

    文章目录 定义 程序的实现 matlab 程序 C语言程序 定义 x(t)={0,t<0At,t≥0 x(t) = \begin{cases} 0,t<0\\ At,t \ge 0\\ \ ...

  6. vtk学习记录(三)——初识vtkRenderer

    目录 前言 vtkRenderer 引入vtk窗口 小结 前言 一场疫情打乱了好多人的节奏,我也一样,一不留神半年都快过去了,这期间虽说一直在鼓捣东西吧,不过确实是没啥实质性的进展,索性就继续把vtk ...

  7. web2

    0x01 <?php $miwen="a1zLbgQsCESEIqRLwuQAyMwLyq2L5VwBxqGA3RQAyumZ0tmMvSGM2ZwB4tws"; funct ...

  8. 【前端背景UI】鼠标磁性动态蜘蛛网背景源码

    <div style="float:right;" id="hub_iframe"></div> <script type=&qu ...

  9. 最短路径——dijkstra算法代码(c语言)

    最短路径问题 看了王道的视频,感觉云里雾里的,所以写这个博客来加深理解.(希望能在12点以前写完) 一.总体思想 dijkstra算法的主要思想就是基于贪心,找出从v开始的顶点到各个点的最短路径,做法 ...

  10. VST的安装

    对需要使用VST的用户,你可以到http://www.soft-gems.net/去免费下载没有使用限制.没有广告的VST.包括例子程序以及说明文档也可以下载到,下载完成后,就是安装,以前版本的VST ...