简体   繁体   English

WAMP中的localhost无法正常工作

[英]localhost in WAMP not working

i use WAMP 2.2. 我使用WAMP 2.2。 installed and the ison is green. 已安装,并且ison为绿色。 problem is the , when I enter locahost in URL , it doesn't work but when I enter 127.0.0.1 it works. 问题是,当我在URL中输入locahost时,它不起作用,但是当我输入127.0.0.1时,它起作用了。

what is the reason ? 是什么原因 ?

Chances are that either: 可能是:

A. Your Windows Hosts file does not have this entry: 答:您的Windows主机文件没有此条目:

127.0.0.1 localhost

B. Or this entry is 1st (comes before the above), and Apache is Listening on IPv4 only: B.或此条目为1st(在上述条目之前),并且Apache仅在IPv4上侦听:

::1 localhost

In the second case, just remove or comment out the entry. 在第二种情况下,只需删除或注释掉该条目。

Hosts file path: 主机文件路径:

C:Windows\system32\drivers\etc\hosts

You'll need to edit Hosts file via 'Run as admin' on Notepad. 您需要通过记事本上的“以管理员身份运行”来编辑主机文件。

You must be using windows 8. Please follow this guide to fix your wamp in Windows 8 您必须使用Windows8。请按照本指南在Windows 8中修复Wamp

How to run WAMP Server on Windows 8 如何在Windows 8上运行WAMP Server

Downgrading to Windows 7 is not a bad option if you are a regular developer. 如果您是常规开发人员,则降级到Windows 7并不是一个不错的选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM