本地主机正在运行,但在Windows 7中不是127.0.0.1 [英] localhost is working but not 127.0.0.1 in windows 7

查看:147
本文介绍了本地主机正在运行,但在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.

  • 您的Web浏览器可能会将计算机上的localhost解析为IPV6回送地址::1.比较键入http://[::1]的结果,并将结果与​​http://127.0.0.1http://localhost进行比较,以查看是否显示任何内容.至于为什么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.

可能已在网络上安装了Web代理,并且已将"Internet选项"或浏览器设置配置为使用它.这将绕过DNS和主机文件,并将请求直接发送到代理.并且代理服务器可能以不同的方式解析127.0.0.1和localhost.这也适用于任何种类的本地代理,Internet加速软件,防病毒扫描程序,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...

这篇关于本地主机正在运行,但在Windows 7中不是127.0.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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