XAMPP 端口 80 正在使用 PID 4 的“无法打开进程”

2022-08-30 10:55:43

XAMPP不起作用,它说

Port 80 in use by "Unable to open process" with PID 4!
6:32:24 PM  [Apache]    Apache WILL NOT start without the configured ports free!
6:32:24 PM  [Apache]    You need to uninstall/disable/reconfigure the blocking application
6:32:24 PM  [Apache]    or reconfigure Apache and the Control Panel to listen on a different port

我已经尝试了删除万维网发布服务的所有内容(该服务不起作用,因为我甚至没有安装它。使用命令提示符,其中显示

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:80             Dave:0                 LISTENING       4
  TCP    0.0.0.0:135            Dave:0                 LISTENING       776
  TCP    0.0.0.0:445            Dave:0                 LISTENING       4
  TCP    0.0.0.0:2382           Dave:0                 LISTENING       2576
  TCP    0.0.0.0:5357           Dave:0                 LISTENING       4
  TCP    0.0.0.0:49152          Dave:0                 LISTENING       548
  TCP    0.0.0.0:49153          Dave:0                 LISTENING       928
  TCP    0.0.0.0:49154          Dave:0                 LISTENING       972
  TCP    0.0.0.0:49155          Dave:0                 LISTENING       1264
  TCP    0.0.0.0:49156          Dave:0                 LISTENING       660
  TCP    0.0.0.0:49157          Dave:0                 LISTENING       1832
  TCP    0.0.0.0:49159          Dave:0                 LISTENING       652
  TCP    0.0.0.0:51782          Dave:0                 LISTENING       1884
  TCP    127.0.0.1:51783        Dave:0                 LISTENING       1884
  TCP    192.168.0.16:139       Dave:0                 LISTENING       4
  TCP    192.168.0.16:50260     stackoverflow:https    ESTABLISHED     5768
  TCP    192.168.0.16:50263     ec2-54-237-50-81:https  ESTABLISHED     5768
  TCP    192.168.0.16:50287     bn1wns1011221:https    ESTABLISHED     1640
  TCP    192.168.0.16:50456     bn1wns2011310:https    ESTABLISHED     1640
  TCP    192.168.0.16:50489     stackoverflow:http     ESTABLISHED     5768

我不明白为什么它不起作用,因为它几天前工作正常,有人可以帮忙,谢谢。当我做netstat -a -b时,它说这个。

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>netstat -a -b

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:80             Dave:0                 LISTENING
 Can not obtain ownership information
  TCP    0.0.0.0:82             Dave:0                 LISTENING
 [httpd.exe]
  TCP    0.0.0.0:135            Dave:0                 LISTENING
  RpcSs
 [svchost.exe]
  TCP    0.0.0.0:443            Dave:0                 LISTENING
 [httpd.exe]
  TCP    0.0.0.0:445            Dave:0                 LISTENING
 Can not obtain ownership information
  TCP    0.0.0.0:2382           Dave:0                 LISTENING
 [sqlbrowser.exe]
  TCP    0.0.0.0:3306           Dave:0                 LISTENING
 [mysqld.exe]
  TCP    0.0.0.0:3306           Dave:0                 LISTENING
 [mysqld.exe]
  TCP    0.0.0.0:5357           Dave:0                 LISTENING
 Can not obtain ownership information
  TCP    0.0.0.0:49152          Dave:0                 LISTENING
 [wininit.exe]
  TCP    0.0.0.0:49153          Dave:0                 LISTENING
  EventLog
 [svchost.exe]
  TCP    0.0.0.0:49154          Dave:0                 LISTENING
  Schedule
 [svchost.exe]
  TCP    0.0.0.0:49155          Dave:0                 LISTENING
 [spoolsv.exe]
  TCP    0.0.0.0:49156          Dave:0                 LISTENING
 [lsass.exe]
  TCP    0.0.0.0:49157          Dave:0                 LISTENING
 [msmdsrv.exe]
  TCP    0.0.0.0:49159          Dave:0                 LISTENING
 Can not obtain ownership information
  TCP    0.0.0.0:51782          Dave:0                 LISTENING
 [sqlservr.exe]
  TCP    127.0.0.1:51783        Dave:0                 LISTENING
 [sqlservr.exe]
  TCP    192.168.0.16:139       Dave:0                 LISTENING
 Can not obtain ownership information
  TCP    192.168.0.16:49180     bn1wns2011302:https    ESTABLISHED
 [Explorer.EXE]
  TCP    192.168.0.16:49267     ec2-54-80-62-105:https  ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49318     bn1wns2011304:https    ESTABLISHED
 [Explorer.EXE]
  TCP    192.168.0.16:49397     ord08s08-in-f14:http   ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49417     ord08s08-in-f14:http   ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49418     ord08s09-in-f5:http    ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49427     static-acs-24-101-16-41:http  TIME_WAIT
  TCP    192.168.0.16:49428     static-acs-24-101-16-24:http  TIME_WAIT
  TCP    192.168.0.16:49429     static-acs-24-101-16-41:http  TIME_WAIT
  TCP    192.168.0.16:49430     static-acs-24-101-16-41:http  TIME_WAIT
  TCP    192.168.0.16:49431     static-acs-24-101-16-41:http  TIME_WAIT
  TCP    192.168.0.16:49432     ord08s08-in-f2:http    ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49434     ord08s08-in-f5:http    ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49435     ord08s08-in-f5:http    ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49436     ord08s08-in-f5:http    ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49437     ord08s08-in-f5:http    ESTABLISHED
 [opera.exe]
  TCP    192.168.0.16:49438     ord08s08-in-f5:http    ESTABLISHED
 [opera.exe]

答案 1

只需将Apache设置为侦听其他端口即可。这可以通过单击与“Apache”模块相同的行上的“配置”按钮来完成,在下拉列表中选择“httpd.conf”文件,然后将“Listen 80”行更改为“Listen 8080”。保存文件并将其关闭。

现在,它避免了端口 80,而是使用端口 8080,而不会出现问题。您唯一需要做的其他事情是确保将localhost:8080放在浏览器中,以便浏览器知道查看端口8080。否则,它默认为端口 80,并且找不到本地站点。


答案 2

因此,我在尝试启动apache服务时遇到了同样的问题,我想与您分享我的解决方案。以下是有关可能使用端口 80 的服务或程序的一些说明:

  1. Skype:默认情况下,Skype 使用端口 80/443。您可以从工具>选项>高级>连接进行更改,并禁用复选框“使用端口 80 和 443 进行其他传入连接”。
  2. IIS:IIS 使用端口 80 作为默认值,因此您需要将其关闭。可以使用以下两个命令 net stop w3svc net stop iisadmin
  3. SQL Server 报告服务:您需要停止此服务,因为如果 IIS 未运行,它可能会占用端口 80。转到本地服务并停止它。

这些选项对我很好,我可以毫无错误地启动apache服务。

另一个选项是从httpd.conf更改apache监听端口并设置另一个端口号。

希望此解决方案可以帮助再次遇到相同问题的人。


推荐