【问题标题】:Cannot Access localhost on Wamp Server(3.06) using 127.0.0.1无法使用 127.0.0.1 访问 Wamp Server(3.06) 上的 localhost
【发布时间】:2017-07-10 18:56:40
【问题描述】:

我正在使用 localhost 获取 WAMP 服务器页面。 但是在 Chrome 中使用 127.0.0.1 时,我得到了

This site can’t be reached
127.0.0.1 took too long to respond.

在 Mozilla 我得到了

The connection has timed out
The server at 127.0.0.1 is taking too long to respond.

所以错误是相似的。

httpd.conf 设置如下:

Listen 0.0.0.0:80
Listen [::0]:80

httpd-vhosts.conf 是这样的:

<VirtualHost *:80>
    ServerName localhost
    ServerAlias localhost
    DocumentRoot e:/wamp/www
    <Directory  "e:/wamp/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

主机文件内容:

127.0.0.1   localhost
::1 localhost

在 CMD 中更新 ping 响应:

C:\Users\pkj>ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

【问题讨论】:

  • 你检查过 wamp 工作了吗?很可能使用端口 80 和 443 进行Skype
  • @RooshanAkthar wamp 正在工作,因为 OP 说 localhost 加载正常
  • @Pawan ,尝试打开你的 CMD 和 ping 127.0.0.1 截图并添加到这里
  • 您在运行 WAMPServer 的 PC 上执行此操作,对吗?不是来自您网络上的另一台 PC?
  • @RiggsFolly - 是的,我正在运行 Wampserver 的 PC 上执行此操作。不是来自网络上的另一台 PC。

标签: php apache wamp


【解决方案1】:

过去这也解决了 Chrome 问题或 2

从使用Run as Administrator开始的命令窗口执行此操作

netsh winsock reset
netsh winsock reset catalog
netsh int ip reset reset.log
netsh int ipv4 reset reset.log
netsh int ipv6 reset reset.log
ipconfig /flushdns

然后根据需要重新启动。

【讨论】:

  • 嗨 - 我已经按照提到的顺序运行了命令,并在除最后一个之外的所有实例中重新启动了 PC。现在我遇到了新问题,我的WAMP server 保持橙色。
  • 好的 - 如果我将端口更改为 8080,我就可以启动 WAMP。不能说在这些命令之间发生了什么。但是现在我无法使用端口 80 启动 WAMP。现在我可以像 localhost:8080 一样访问 localhost。 127.0.0.1 仍然无法正常工作。我注意到可能解决问题的一件事是,当我 ping localhost 时,回复来自 ::1,而当我 ping 127.0.0.1 时,回复来自 127.0.0.1。
  • 看起来 wamp 服务器 localhost 无法解析为 IPV4 地址。
  • ::1 通常是现在尝试使用的默认网络,为 IPV4 关闭时做准备
猜你喜欢
  • 2012-01-31
  • 2015-12-03
  • 2011-12-19
  • 2016-01-22
  • 2018-02-23
  • 2015-11-03
  • 2012-07-19
  • 2021-12-31
  • 2020-01-21
相关资源
最近更新 更多