nginx 报错 [emerg] 1164#1664: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)

[emerg] 4276#4280: bind() to 0.0.0.0:80 failed(10013: An attempt was made to access a socket in a way forbidden by its access permissions)此错误信息,从错误信息可以看出是因为80端口被占用导致Nginx无法启动。

解决办法

1、  按键盘win+r 打开运行界面,输入cmd,确定,打开管理员界

2  、输入netstat -aon | findstr :80 

查找端口占用情况,找到提示占用的端口号0.0.0.0:80,我的是Apache2.4(之前配置php开发环境时用的)占用了,查看后,pid值为1884

 

3 、 输入tasklist|findstr "1884"  

找到1884端口对应的服务名称,为httpd.exe,这个是apache2.4。如果不知道是哪个文件的,可以百度一下找到对应的服务名称。

  

 

 

4 、 然后再计算机的服务里停止对应的服务,解除占用

 nginx 报错 [emerg] 1164#1664: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)_第1张图片

 

 6.有的情况下还会是系统system进程占用了80端口,这个时候需要停掉branchcache 这个服务,

nginx 报错 [emerg] 1164#1664: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)_第2张图片

 

 

 nginx 报错 [emerg] 1164#1664: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)_第3张图片

 

 

5、最后:将服务停止之后Nginx就能正常启动了,如果别的端口占用问题也可用此办法进行解决。简单写写,当做自己的笔记,也希望能帮到别人。
————————————————

你可能感兴趣的:(nginx 报错 [emerg] 1164#1664: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions))