如何释放本地 Windows 上的 80 端口?
我安装了 XAMPP 1.6.8,但由于某种原因它不起作用。 后来发现80端口没有空闲或者没有监听。 我怎样才能释放它或使其免费?
多谢!
I installed XAMPP 1.6.8 and for some reason it didn't work. Later realized port 80 is not free or not listening. How can I release it or make it free?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(18)
侦听端口 80 的已知 Windows 服务
从服务管理器(运行:services.msc)中,停止并禁用这些已知绑定到端口 80 的 Windows 服务。
双击服务,并将“启动类型”更改为“禁用”...
skype 也使用端口 80 作为默认设置,您可以取消选中它。
您可能安装并运行了其中一些服务,也可能没有。
在我的例子中,“SQL Server Reporting Services”正在打开端口 80。
Known Windows Services That Listen on Port 80
From Services Manager (run: services.msc), stop and disable these Windows Services which are known to bind to port 80.
Double click Service, and change ‘Startup Type’ to ‘Disabled’…
skype also using port 80 as default setting and you can uncheck it.
You might, or might not, have some of these Services installed and running.
In my case "SQL Server Reporting Services" was opening port 80.
以编程方式识别真实进程
(当进程 ID 显示为 4 时)
这里的答案与往常一样,期望一定程度的交互性。
问题是当某些东西通过 HTTP.sys 监听时; 然后,PID 始终为 4,并且正如大多数人发现的那样,您需要一些工具来找到真正的所有者。
以下是如何以编程方式识别有问题的进程。 没有 TcpView 等(与这些工具一样好)。 是否依赖netsh; 但问题通常与 HTTP.sys 有关。
最初发布于此处:https://stackoverflow.com/a/65852847/6274530
Identify the real process programmatically
(when the process ID is shown as 4)
The answers here, as usual, expect a level of interactivity.
The problem is when something is listening through HTTP.sys; then, the PID is always 4 and, as most people find, you need some tool to find the real owner.
Here's how to identify the offending process programmatically. No TcpView, etc (as good as those tools are). Does rely on netsh; but then, the problem is usually related to HTTP.sys.
Originally posted here: https://stackoverflow.com/a/65852847/6274530
我遇到了同样的问题,并通过在 httpd.conf 文件中进行一些小的更改来修复它,该文件可以通过单击配置按钮和 Apache 选项来获得。
我所做的更改是将listen 80 替换为listen 8080。
I faced the same issue and fixed it by making a small change in the
httpd.conf
file which can be obtained by clicking the config button along with the Apache option.The change I made was to replace listen 80 with listen 8080.
对于我来说,当我在 Windows 8 计算机上托管 VPN 连接时,这个问题就开始出现了。
只需从“控制面板\网络和 Internet\网络连接”中删除连接即可解决问题。
For me, this problem began when I hosted a VPN-connection on my Windows 8 computer.
Simply deleting the connection from "Control Panel\Network and Internet\Network Connections" solved the problem.
我发现接管80端口的是http api服务。 我在cmd中写道:
问我“以下服务将被停止,是否要继续?” 按 y
它实际上停止了许多服务。
然后写入
localhost
和 wallah,Apache 已启动并在端口 80 上运行。重要:Skype 默认使用端口 80,您可以在 Skype 选项 > 中更改此设置。 高级> 连接 - 并取消选中“使用端口 80”
I found out that what was taking over port 80 is http api service. I wrote in cmd:
Asked me "The following services will be stopped, do you want to continue?" Pressed y
It stopped a number of services actually.
Then wrote
localhost
and wallah, Apache is up and running on port 80.Important: Skype uses port 80 by default, you can change this in skype options > advanced > connection - and uncheck "use port 80"
netstat -ano
这将显示正在侦听端口 80 的进程的 PID。
之后,打开任务管理器-> 进程选项卡。 从
查看 -> 选择Columns
菜单,启用PID
列,您将看到侦听端口80的进程的名称。netstat -ano
That will show you the PID of the process that is listening on port 80.
After that, open the Task Manager -> Processes tab. From the
View -> Select Columns
menu, enable thePID
column, and you will see the name of the process listening on port 80.我以前遇到过这个问题,
如果你看到任务管理器(启用PID视图后),你会发现PID=4是“NT Kernel & System正在使用端口80;”
只需进入
IIS
下的万维网服务
是否被选中如果是,取消选中并再次netstat(或TCPVIEW)以查看80是否空闲。
I had this problem previously,
if you see the Task manager(after enabling the view for PID), you will find PID=4 is "port 80 in use by NT Kernel & System; "
Just go to
World wide web services
underIIS
is checkedIf so, Uncheck and netstat(or TCPVIEW) again to see if 80 is free.
netstat -a -b
应该告诉你什么程序绑定到端口 80
netstat -a -b
Should tell you what program is bound to port 80
在提升的命令提示符中使用 netstat -bano 来查看哪些应用程序正在侦听哪些端口。
但通常以下应用程序在 Windows 中使用端口 80。
停止以上应用程序(如果正在运行)并检查!
use netstat -bano in an elevated command prompt to see what apps are listening on which ports.
But Usually following applications uses port 80 in windows.
Stop above applications if running and check!!!
使用TcpView找到监听端口的进程并关闭该进程。
Use TcpView to find the process that listens to the port and close the process.
可以尝试的其他选项是停止 SQL Server Reporting Services。
Other option to try is to stop SQL Server Reporting Services.
在命令行中输入“netstat -ano”。 我看到它显示了本地地址端口 0.0.0.0:80 的内容。
我的问题是因为我在端口 80 上有 SQL Server Reporting Services。因此,我按照以下说明将端口号从 80 更改为 81:
http://seankilleen.com/2012/11/how-to -stop-sql-server-reporting-services-from-using-port-80-on-your-server-field-notes/
这是我更改 SQL Server 端口号后的命令行图片Reporting Services:
如果您仍然遇到相同问题,请阅读此论坛:
http://forum.wampserver.com/read.php?2,66196,66233#REPLY
Type in "netstat -ano" into your command line. I saw that it was showing something for Local Address port 0.0.0.0:80.
My issue was because I had SQL Server Reporting Services on Port 80. So I followed these instructions and changed the port # from 80 to 81:
http://seankilleen.com/2012/11/how-to-stop-sql-server-reporting-services-from-using-port-80-on-your-server-field-notes/
Here is a picture of my command line AFTER I changed the port number for SQL Server Reporting Services:
If you are still having the same issue, read this forum:
http://forum.wampserver.com/read.php?2,66196,66233#REPLY
您可以使用
net stop http
它将显示正在使用哪个进程。 大多数万维网服务正在使用You can use
net stop http
it will display which process is using. Moslty world wide web services are using尝试
显示端口和进程
Try
that show ports and processes
我试图从这里安装
nginx
- http://nginx.org /en/docs/windows.html转到 http://localhost/ 将显示一些内容,至少是一个正确的“未找到”消息
这是因为80是默认端口,它被其他进程占用了。
现在运行以下命令:
现在,访问 http://localhost/ 将失败,并显示损坏的链接页面消息。
主要流程是
BranchCache
该进程停止后,将在几秒钟后重新启动。
因此,我们需要很快运行我们需要的其他命令,如下所示:
现在,转到 http://localhost/ 给了我:
希望有帮助。
I was trying to install
nginx
from here - http://nginx.org/en/docs/windows.htmlGoing to http://localhost/ will show something, at least a proper "not found" message
This is because 80 is the default port, and it was taken by other processes.
Now run below command:
Now, going to http://localhost/ will fail with a broken link page message.
Main process was
BranchCache
This process, after stopped, will restart in a few seconds.
So we need to run other commands we need soon, an example below:
Now, going to http://localhost/ gave me:
Hope that helps.
这只是一个猜测,但由于端口 80 是 HTTP 的传统端口,因此您的系统上可能运行着一个 Web 服务器。 IIS 是否处于活动状态?
如果您正在运行 IIS,则可能正在运行网络场服务。 这就是杀死我的 xampp 的原因。
This is just a guess, but since port 80 is the conventional port for HTTP, you may have a webserver running on your system. Is IIS active?
If you are running IIS you may have the web farm service running. That was what was killing my xampp.
Skype喜欢使用端口80并阻止IIS。 那是我的问题。
Skype likes to use port 80 and blocks IIS. That was my prob.
我也有同样的问题。
net stop http
没有帮助,并且 Windows 控制面板中 IIS 下的 万维网服务 选项未选中。 因此,在 XAMPP 控制面板中,我只需选中 Apache 启动按钮(将 Apache 安装为服务)附近的 Svc 复选框并重新启动 Windows。 现在,每次 Windows 启动时,Apache 都会自动启动,并先于任何其他服务占用端口 80。 为我工作!I also had the same problem.
net stop http
didn't help and World wide web services option under IIS in Windows Control Panel was unchecked. So in XAMPP control panel I just checked the Svc checkbox near Apache start button (Install Apache as service) and rebooted Windows. And now each time Windows starts Apache is started automatically and occupies port 80 before any other service does. Worked for me!