Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法使用127.0.0.1访问Wamp服务器(3.06)上的本地主机_Php_Apache_Wamp - Fatal编程技术网

Php 无法使用127.0.0.1访问Wamp服务器(3.06)上的本地主机

Php 无法使用127.0.0.1访问Wamp服务器(3.06)上的本地主机,php,apache,wamp,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. The connection has timed out The server at 127.0.0.1 is taking too long to respond. 在Mozilla中,我得到了 This site can’t be reached 127

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

This site can’t be reached
127.0.0.1 took too long to respond.
The connection has timed out
The server at 127.0.0.1 is taking too long to respond.
在Mozilla中,我得到了

This site can’t be reached
127.0.0.1 took too long to respond.
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
<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>
httpd-vhosts.conf是这样的:

Listen 0.0.0.0:80
Listen [::0]:80
<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>
更新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
C:\Users\pkj>ping 127.0.0.1
使用32字节数据ping 127.0.0.1:

127.0.0.1的回复:字节=32次在过去,这也解决了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

然后在必要时重新启动。

是否检查wamp是否正常工作?很可能是skype使用端口80和443@RooshanAktharwamp正在工作,因为OP说本地主机加载fine@Pawan,尝试打开CMD并
ping 127.0.0.1
截图并添加到此处您正在运行WAMPServer的PC上执行此操作,对吗?不是从您网络上的另一台PC上?@RiggsFolly-是的,我正在运行Wampserver的PC上执行此操作。不是从网络上的另一台电脑。嗨-我已经按照上面提到的顺序运行了这些命令,并在所有情况下重新启动了电脑,最后一个除外。现在我遇到了一个新问题,我的
WAMP服务器保持橙色。好的-如果我将端口更改为8080,我就可以启动WAMP了。我说不出这两个命令之间发生了什么。但现在我无法使用端口80启动WAMP。现在我可以访问localhost,比如localhost:8080。127.0.0.1仍不工作。我注意到有一件事可能会解决这个问题:当我ping localhost时,回复是来自
::1
,当我ping 127.0.0.1时,回复是来自127.0.0.1。看起来wamp服务器localhost无法解析为IPV4地址。
::1
通常是现在尝试使用的默认网络对象,为IPV4关闭做好准备