我试图为我的应用服务器使用端口80,但当我执行netstat -aon时,我得到:

TCP 0.0.0.0:80 0.0.0.0:0监听4

当我在任务管理器中查找进程时,它显示PID 4是SYSTEM,就是这样。没有扩展…什么都没有。“系统”。这是怎么回事?

我害怕结束这个过程,我该怎么办?


当前回答

这个过程对我很有用:

右键单击我的电脑。 选择管理。 双击“服务和应用程序”。 然后双击“服务”。 右击“万维网出版服务”。 选择停止 重启XAMPP

其他回答

以编程方式标识流程

到目前为止,所有的答案都要求用户进行一些交互操作。这就是当netstat显示PID 4时如何找到PID,而不需要打开一些GUI或处理有关依赖服务的对话。

$Uri = "http://127.0.0.1:8989"    # for example


# Shows processes that have registered URLs with HTTP.sys
$QueueText = netsh http show servicestate view=requestq verbose=yes | Out-String

# Break into text chunks; discard the header
$Queues    = $QueueText -split '(?<=\n)(?=Request queue name)' | Select-Object -Skip 1

# Find the chunk for the request queue listening on your URI
$Queue     = @($Queues) -match [regex]::Escape($Uri -replace '/$')


if ($Queue.Count -eq 1)
{
    # Will be null if could not pick out exactly one PID
    $ProcessId = [string]$Queue -replace '(?s).*Process IDs:\s+' -replace '(?s)\s.*' -as [int]

    if ($ProcessId)
    {
        Write-Verbose "Identified process $ProcessId as the HTTP listener. Killing..."
        Stop-Process -Id $ProcessId -Confirm
    }
}

那可真让我受不了。我讨厌HttpListener,希望我只使用Pode。

我今天才遇到这个问题,因为它出现在诺顿请求重启之后,我责怪诺顿。 但不是诺顿,我删除了诺顿,重新启动->问题仍然存在。

netstat -nao显示PID 4拥有我的端口80连接。

然后我进入控制面板, 然后“打开或关闭Windows功能” 然后勾选“互联网信息服务”。 重启后,问题就消失了。 我的xampp服务器现在运行正常。

我不记得我一开始是怎么打开IIS的。 这件事发生之前,我已经跑了好几个月了。 我还是不知道最初是什么引起的。 也许是之前的一个windows更新启用了iis,我的重启把它打开了,我不知道。

我发现“SQL Server Reporting Services (MSSQLSERVER)”自动启动并在端口80上监听。

我希望这能有所帮助。

O

这些对我都没用。我不得不回答一个超级用户的问题。

If it is a System Process—PID 4—you need to disable the HTTP.sys driver which is started on demand by another service, such as Windows Remote Management or Print Spooler on Windows 7 or 2008. There is two ways to disable it but the first one is safer: Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (or set it to manual, some services depended on it). Reboot and use netstat -nao | find ":80" to check if 80 is still used.

这招对我很管用!

我有同样的问题,除了我从来没有使用IIS。当我修复另一个系统错误时,我将apache服务设置为手动启动,希望降低系统的复杂性。在我修复了另一个bug后,apache无法启动。我弄了一段时间,但只需要将apache设置为自动启动:启动>管理工具>服务。

显然,当Apache以这种方式启动时,它会在SYSTEM进程之前声明端口80。

hth某人。我在谷歌上搜索的结果都是“IIS和Apache不能在同一台机器上”。“这是为了我们当中的百分之一。