无法使用127.0.0.1访问Wamp Server(3.06)上的localhost

时间:2017-02-21 08:44:35

标签: php apache wamp

我正在使用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

1 个答案:

答案 0 :(得分:0)

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

从使用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

开始的命令窗口执行此操作
override func viewDidLoad() {
    super.viewDidLoad()

    Alamofire.request(APIURL).responseJSON { response in
        print(response.result)   // result of response serialization
        let result = response.result

        if let dict = result.value as? Dictionary<String, AnyObject> {
            let currentDate = dict["fulldate"] as? String
            self.timeLbl.text = currentDate
            }

    }
}

然后在必要时重启。