错误

第一次探索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. 【阅读笔记】Ranking Relevance in Yahoo Search (三)—— query rewriting

    5. QUERY REWRITING 作用: query rewriting is the task of altering a given query so that it will get bet ...

  2. Muduo网络库实战(二):实现服务器与客户端的连接

    1. 方案的确定 1)基本需求 用户1000+, IO压力不大: 多个客户端打开网站,输入查询字符串strclient,发送给服务器=>服务器接收客户端发过来的数据并处理,将结果返回给客户端: ...

  3. Mysql 字符串拆分 OR 一行转多行

    Mysql 字符串拆分 OR 一行转多行 需要了解的的几个mysql 函数: A.substring_index():字符串截取 substring_index(str,delim,count)   ...

  4. NodeJS实现websocket代理机制

    使用的模块 ws http http-proxy 主要通过htt-proxy实现中转 启动websocket服务 var WebSocketServer = require('ws').Server; ...

  5. C语言编程入门题目--No.13

    题目:打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数 本身.例如:153是一个"水仙花数",因为153= ...

  6. 小老板,我300M的网,网速很慢怎么办?

    首先考虑是不是DNS的问题: 我们先测试一下! 一.Google的DNS: 8.8.8.8 丢包严重 PASS但是扶墙的时候是必备的,如果有扶墙的需求的话可以备用. 二.百度DNS 180.76.76 ...

  7. IBM Rational Rose软件下载以及全破解方法

    最近忙着作业,软件设计的类图着实难画,于是整理了rose的下载和破解方法 Rational Rose是Rational公司出品的一种面向对象的统一建模语言的可视化建模工具.用于可视化建模和公司级水平软 ...

  8. Intersection of Two Linked Lists (求两个单链表的相交结点)

    题目描述: Write a program to find the node at which the intersection of two singly linked lists begins. ...

  9. CTF-Pwn-[BJDCTF 2nd]diff

    CTF-Pwn-[BJDCTF 2nd]diff 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢!本文仅用于学习与交流,不得用于非 ...

  10. 09_CSS入门和高级技巧(7)

    浏览器兼容问题 1.现在中国网民用什么浏览器? 中国流量最大的网站就是百度,百度在统计着每一个访问者的浏览器.地域.操作系统.分辨率等等信息. 百度流量研究院:http://tongji.baidu. ...