localhost 正在工作,但在 Windows 7 中没有 127.0.0.1 [英] localhost is working but not 127.0.0.1 in windows 7

查看:18
本文介绍了localhost 正在工作,但在 Windows 7 中没有 127.0.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 7 上运行 xampp.当我执行 http://localhost 时,我在 Web 浏览器中看到 xampp 欢迎屏幕,但 http://127.0.0.1代码> 不起作用.在我的 Windows 主机文件中,我取消了 127.0.0.1 localhost 的注释,但问题仍然存在.我检查了防火墙是否阻止了任何东西,但仍然没有好的结果.

I am running xampp on windows 7. When I do http://localhost, I get the xampp welcome screen in my web browser but http://127.0.0.1 does not work. In my windows hosts file, I have uncommented 127.0.0.1 localhost but the problem still exists. I have checked to see if firewall is blocking anything but still no good results.

我该如何解决这个问题.

How do I resolve this problem.

推荐答案

暗中猜测二三枪.这就是我诊断问题的方式.

Two or three shot in the dark guesses. This is how I would diagnose the issue.

  • 您的网络浏览器可能正在将计算机上的 localhost 解析为 IPV6 环回地址 ::1.比较键入 http://[::1] 的结果,并将结果与​​ http://127.0.0.1http://localhost<进行比较/code> 看看这是否揭示了什么.至于为什么 xampp 在 IPV6 上工作,而不是 IPV4 是另一个问题.

  • It's possible that your web browser is resolving localhost on your computer to the IPV6 loopback address, ::1. Compare the results of typing http://[::1] and compare the results to http://127.0.0.1 and http://localhost to see if that reveals anything. As to why xampp is working on IPV6, but not IPV4 is another issue.

可能在您的网络上安装了网络代理,并且您的 Internet 选项或浏览器设置已配置为使用它.这将绕过 DNS 和主机文件并将请求直接发送到代理.并且代理服务器可能以不同的方式解析 127.0.0.1 和 localhost.这也适用于任何类型的本地代理、互联网加速软件、防病毒扫描程序、Fiddler 等...尝试转到控制面板-> Internet 选项并选择连接选项卡.然后选择局域网设置"按钮.确保此对话框中的所有复选框均已关闭.运行连接"对话框顶部的设置"按钮以确保安全.见下图

You might have a web proxy installed on your network and your Internet Options or browser settings is configured to use it. This will bypass DNS and the hosts file and send the request straight to the proxy. And the proxy server probably resolves 127.0.0.1 and localhost differently. This also applies to any sort of local proxy, internet speed-up software, anti-virus scanner, Fiddler, etc... Try going to Control Panel->Internet Options and select the Connections tab. Then select the "LAN settings" button. Make sure all the checkboxes are turned off on this dialog. Run the "Setup" button at the top of the Connections dialog just to be sure. See picture below

禁用 Windows 防火墙和/或您可能拥有的任何其他类型的防火墙软件.这样我们就可以排除这种可能性.有什么变化吗?

Disable the Windows Firewall and/or any other sort of Firewall software you may have. Just so we can rule that out. Any change?

但你最好的选择是安装 Wireshark 或 Netmon 并获取 http://localhost 连接的痕迹并将其与 http://127.0.0.1 进行比较 地址.这应该会揭示一些东西......

But your BEST option will be to install Wireshark or Netmon and get a trace of http://localhost connection and compare that to the http://127.0.0.1 address. That should reveal something...

这篇关于localhost 正在工作,但在 Windows 7 中没有 127.0.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆