[转]80端口被系统占用pid=4: NT kernel & System

新装了win7后,在启动Apache的时候,总是启动失败,查看80端口,被pid=4的进程占用,打开任务管理器,发现pid=4的进程居然是个系统进程!

尝试终结此进程,结果是蓝屏。

解决过程:

在网上查了许久,发现以下解决方案:

(来源网址http://www.cameroncooke.com/2009/01/25/windows-7-uses-port-80-and-makes-it-impossible-to-install-apache-solution/comment-page-1/#comments

原文:

I work on Http.sys technology at Microsoft and somebody sent me a link to this blog. I am a bit surprised by this behavior you are seeing on Windows7 Beta and with some help from you, I will like to find out the root cause of this issue so that we can take the appropriate action if needed.http://msdn.microsoft.com/en-us/library/aa364434(VS.85).aspx ). In your case, some application is running which is using http.sys to listen on port 80. This is preventing Apache from using port 80. We offer a mechanism for applications to help control port sharing but I’ll need to look into the specific application that’s causing you this conflict. If you can give us the output of following command “netsh http show servicestate”, then it will allow me to find out which application is using http.sys. Since you have disabled http.sys, please follow these steps listed below before running the command:

After you have run this command, you can disable http.sys as follows:

Please let me know if you face any issues in the process.

Thanks,

部分翻译如下:

该进程是Http.sys。它是http API的驱动组件,Http栈服务器。如果该端口被Http.sys占用,说明一些正在使用http.sys的应用程序在运行。这就是阻止Apache运行的原因,因为Http.sys占用着80端口。我们提供了一种应用程序的机制来帮助控制端口共享,但是我需要调查导致你遇到这种困难的是什么特殊应用程序。如果你能提供给我们“netsh http show servicestate”这条命令的输出结果,我就能找出是哪个应用程序在使用Http.sys。在你禁用Http.sys之前,请按照下面的步骤来运行命令:

1. sc config http stat = demand

2. reboot

3. run the command(netsh http show servicestat)as administrator

在你使用这个命令之前,你可以按照下面步骤禁用http.sys:

1. net stop http

2. Sc config http start= disabled

----------------------------

解决了以上问题后,发现该进程居然又占用了445端口,apache依然无法启动,在网上搜了许久,最终放弃了直接解决方案。一怒之下,删掉了原来的xampp,使用安装版的xampp,启动apache,居然启动成功!

问题虽然解决,却不知何故…

原文地址:https://www.cnblogs.com/iomango/p/2765651.html