PhpStudy下Apache端口被占用无法打开终极解决方案

昨天为了恢复我的博客在本地装了phpstudy却发现Apache端口打不开了,根据网上查的方法:

1、运行cmd,然后输入netstat -a -n -o,回车;
2、查看开头几行包含0.0.0.0:80的那一行最后的pid,为几个数字,把这几个数字记下来;
3、启动“任务管理器”——“进程”,在“工具栏”——“选择列”前面的框里打上勾;
4、然后找到与刚才那个pid对应的是哪个程序,很容易就会找到,就是它与0.0.0.0:80进行了绑定(bind);

却发现任务管理器里面根本就没有PID=4的任务。。。。

最后尝试了另一种方法得以解决:

win+R:输入regedit-调出注册表

找到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP

找到一个DWORD值Start,将其改为0

重启电脑,System进程将不会占用80端口

就可以打开你的apache了

11 Comments

  1. Good day! I know this is kinda off topic nevertheless
    I’d figured I’d ask. Would you be interested in trading links or maybe
    guest writing a blog post or vice-versa? My site covers a lot of the same topics as yours and I think we could greatly benefit from each other.
    If you happen to be interested feel free to shoot me an email.

    I look forward to hearing from you! Superb blog by the way!

  2. Hi there! This article couldn’t be written much better!
    Reading through this article reminds me of my previous roommate!
    He continually kept preaching about this. I’ll send this post to him.
    Fairly certain he’ll have a very good read. Thanks for sharing!

Comments are closed.