I am using wamp for few years and i upgraded to windows 8 few months before, my wamp working smoothly up to yesterday. But now it can't be accessed using localhost. but when i trying 127.0.0.1 instead it works smoothly. I changed ::1 localhost to 127.0.0.1 localhost in host file. which where the solution suggested for this problem in most websites. But unfortunately its not work for me. When i ping localhost its showing replay from ::1: time<1ms. And There is no software's using port 80 i already checked it. please help to solve this.
Localhost is often considered synonymous with the IP address 127.0. 0.1.
The localhost simulates a web server running on your computer. When the “localhost refused to connect” error appears, it is likely due to misconfigured port. Other common reasons include insufficient permissions and the Apache webserver not running properly.
If you want to connect to your own computer, you can do so like any other IP address. Open up your web browser and type 127.0. 0.1 into the address bar, then press Enter. If you can't remember numbers very well, you can type localhost instead.
Go to Chrome setting > Privacy and Settings > See all the cookies and site data, search for localhost and delete it. Then refresh your site it will be working.
Mine is Ubuntu 20.04 VM
I had this following line.
::1 localhost ip6-localhost ip6-loopback
I commented that line and added the following line.
::1 ip6-localhost ip6-loopback
Basically removed
::1 localhost
It now works.
The final look of the hosts file is as follows.
127.0.0.1 localhost
127.0.1.1 vagrant.vm vagrant
# The following lines are desirable for IPv6 capable hosts
#::1 localhost ip6-localhost ip6-loopback
::1 ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.2.1 w1 w1
Edit
%SystemRoot%\system32\drivers\etc\hosts
and replace
::1 localhost
with
127.0.0.1 localhost
Save and restart apache. Hope it will work .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With