启动Windows版本的Nginx时候,cmd报错,报错信息为[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无法启动。

排查

# 查看端口占用情况
D:\nginx-1.20.1>netstat -aon | findstr :80

Nginx系列(5)- nginx: [emerg] 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)_nginx

# 查找对应服务
D:\nginx-1.20.1>tasklist|findstr "4"

Nginx系列(5)- nginx: [emerg] 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)_nginx_02

# 找到对应的服务,停止服务后,Nginx的80端口就可以用了

# 但是我这个是System,把他关了,要不蓝屏,要不系统崩掉;所以只能去换监听端口了

Nginx系列(5)- nginx: [emerg] 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)_nginx_03

Nginx系列(5)- nginx: [emerg] 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)_Nginx_04

Nginx系列(5)- nginx: [emerg] 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)_报错信息_05