wamp 服务器的 DNS 查找失败

DNS lookup failed with wamp server

我已经安装了 wamp 2.5 和 apache 2.4.9。我在 www 文件夹中添加了一个简单的 php 文件。当我尝试从本地主机访问它时,收到以下消息:

The server at main can't be found, because the DNS lookup failed. DNS is the
network service that translates a website's name to its Internet address. This
error is most often caused by having no connection to the Internet or a
misconfigured network. It can also be caused by an unresponsive DNS server or
a firewall preventing Google Chrome from accessing the network.

DNS 查找失败问题的解决方案是什么?我正在使用 windows 7.

您似乎正尝试通过键入 http://main/ 访问该网页。问题是 Google-Chrome 试图解析域 main 但失败了,因为它不存在。

一个解决方案是将域 main 添加到 C:\Windows\System32\Drivers\etc\hosts 中的 hosts 文件,提供更详细的帮助 here.

更好的方法是检查您在 Apache 中使用 ServerName 指令配置的服务器的名称并尝试使用它。