Php – How to fix localhost refused to connect on Windows 10 Wamp server and Xampp

apachehtmlmysqlphp

I've installed WAMP Server on Windows 10 and it was working fine. But when I try to load localhost today it gives me refused to connect error. I've read some questions on Stack Overflow and tried their answers but no luck.

  • Re-installed wamp (also tried xampp. non of these work)
  • IIS is off
  • Web Development.. thing in services is not running.
  • Tried netstat -aon and port 80 PID is same as wampapache64 process.
  • changed listening port to 81 in httpd.conf in wamp => apache =>
  • Cleared browser cache
  • Wamp icon is green
  • Can't connect using 127.0.0.1

Nothing works.

Screenshots:

enter image description here

PID is 7724

enter image description here

enter image description here
enter image description here
enter image description here
enter image description here

Best Solution

  • I will assume the wamp icon in the system tray is green. I think you should start tracing the root cause from the apache error/access log.
  • Try change the http port to 8080 and access localhost:8080. left click the wamp icon in the taskbar, go to apache > httpd.conf and edit this file: change "listen to port .. 80" to 8080.
  • Try the hosts file with only the initial records and test.

    127.0.0.1 localhost ::1 localhost

  • If you are facing the error from the apache errors log file

(OS 10038)An operation was attempted on something that is not a socket. : AH00332: winnt_accept: getsockname error on listening socket, is IPv6 available?

then do the following: * Run 'command prompt' as administrator and run the command netsh winsock reset . and restart the PC.

  • Skype default port is 80 and this might be having a conflict .. try to change it from Skype options.
  • Finally make sure the antivirus or any firewall you are having is not blocking your application requests.
Related Question