問題描述
我在 Windows 7(測試版)上打開 http://localhost/ 時遇到了大問題.我安裝了這個操作系統,一切都很好;當我安裝 Wamp 時,我看到 localhost 根本不起作用.我只看到這個錯誤:
I have a big problem opening http://localhost/ on Windows 7 (beta). I installed this os and everything went great; when I installed Wamp I saw that localhost is not working at all. I just see this error:
Firefox 無法與 localhost 上的服務器建立連接.
Failed to Connect
Firefox can't establish a connection to the server at localhost.
在 Mozilla 和資源管理器中.
in Mozilla and Explorer.
我刪除了 Wamp,幾周后(這意味著從今天起兩周)我在 Windows 7 上安裝了 NetBeans.我創建了一個測試 PHP 腳本,當我調試它時,我再次遇到相同的錯誤.我試圖用 ip 127 訪問它......但還是一樣.有什么問題?
當我安裝 NetBeans 時,我將其安裝在 8080 端口.
I removed Wamp and after some weeks (that means two weeks from today) I installed NetBeans on Windows 7. I created a test PHP script and when I debug it, I get the same error again. I tried to access it with ip 127.... but still the same. What is the problem?
When i installed NetBeans I installed it in port 8080.
推薦答案
要解決 80 端口問題,請執行以下操作:
To fix the port 80 problem do:
從 cmd 以管理員身份:
From cmd as administrator:
sc config http start= demand
(你需要在等號之后而不是之前有一個空格)- 重啟
- 以管理員身份運行命令 (
netsh http show servicestate
) 以檢查端口 80 是否正在使用中
sc config http start= demand
(you need a space after the equal sign and not before)- Reboot
- Run the command (
netsh http show servicestate
) as administrator to check that the port 80 is in use
運行此命令后,您可以禁用http.sys,如下所示:
After you have run this command, you can disable http.sys as follows:
net stop http
(停止進程)Sc config http start= disabled
(如果你想永久禁用該服務)
net stop http
(stop the process)Sc config http start= disabled
(if you want to disable the service forever)
它對我有用.
這篇關于http://localhost/在 Windows 7 上不工作.有什么問題?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!