如何解决phpEnv在0.0.0.0:80端口上监听失败的端口占用问题?
- 内容介绍
- 文章标签
- 相关推荐
本文共计820个文字,预计阅读时间需要4分钟。
直接说结论:
怎么快速确认 80 端口被谁占了
打开管理员权限的 CMD 或 PowerShell,依次执行:
-
netstat -ano | findstr :80—— 查看监听 80 的 PID(比如输出里有0.0.0.0:80 ... 4,说明 PID=4 在占用) -
tasklist | findstr "4"—— 若 PID 是 4,通常对应System进程,本质是http.sys在托管;若 PID 是其他数字(如 1234),就查对应进程名(如httpd.exe、nginx.exe、skype.exe) -
netsh http show servicestate—— 明确看到哪些 URL 前缀注册在 80 上(如http://+:80/),确认是否来自HTTP Service
关闭 HTTP Service(最常见且有效的解法)
当 netstat 显示 PID=4 且 netsh http show servicestate 有注册项时,基本锁定是 Windows 自带的 HTTP Service 占用。它常被 IIS、Web Deploy、SQL Server Reporting Services 或某些旧版软件悄悄启用。
本文共计820个文字,预计阅读时间需要4分钟。
直接说结论:
怎么快速确认 80 端口被谁占了
打开管理员权限的 CMD 或 PowerShell,依次执行:
-
netstat -ano | findstr :80—— 查看监听 80 的 PID(比如输出里有0.0.0.0:80 ... 4,说明 PID=4 在占用) -
tasklist | findstr "4"—— 若 PID 是 4,通常对应System进程,本质是http.sys在托管;若 PID 是其他数字(如 1234),就查对应进程名(如httpd.exe、nginx.exe、skype.exe) -
netsh http show servicestate—— 明确看到哪些 URL 前缀注册在 80 上(如http://+:80/),确认是否来自HTTP Service
关闭 HTTP Service(最常见且有效的解法)
当 netstat 显示 PID=4 且 netsh http show servicestate 有注册项时,基本锁定是 Windows 自带的 HTTP Service 占用。它常被 IIS、Web Deploy、SQL Server Reporting Services 或某些旧版软件悄悄启用。

