
The firewall configuration tool on Linux systems varies depending on the distro. Also, make sure to turn on the firewall once you have finished working with localhost. If localhost still refuses to connect, move on to other potential causes.
Once you disable the firewall, navigate to localhost in a browser to check whether it connects. (For OS-specific instructions, see sections below.) Temporary Disable the FirewallĬheck whether the firewall settings are blocking the localhost connection by disabling the firewall temporarily. The sections below provide methods to resolve the localhost refused to connect error. How to Solve the Localhost Refused to Connect Error? The best way to do so it to test out each probable cause, starting from the most frequent ones. To solve the issue, identify the source of the error. The browser settings blocking the connection.The server being accessed from the wrong port.Localhost doesn't resolve to 127.0.0.1.
The server being blocked by the firewall. What Causes the Localhost Refused to Connect ErrorĬommon causes that result in localhost refusing to connect: ERR_CONNECTION_TIMEOUT (the server has not responded to the request and the client is still waiting for a response). ERR_CONNECTION_REFUSED (the server rejected the request for connection). Have you done that?Īre the programs running? Do you see xampp.exe and dbserver.The localhost refused to connect message displays one of two possible errors: If xampp.exe is installed on the C: drive, and the data files that it needs are on the D: drive, then when you plug the drive in and D: becomes available, you will need to stop xampp and restart it. How exactly do you "start xampp"? Is it a Windows Service, or do you click on some link to launch the program? Does it show a console window where you can see messages that it produces? What folders do you have them installed to? Something like C:\Program Files\Xampp\Xampp.exe? Or did you install them to the removable drive and have them on a different drive letter like D:\Program Files\Xampp\Xampp.exe?ĭoes the external drive show up with the same drive letter every time? Is it the D: drive or some other letter? Boot PC,start xampp,start db server,all runs fine.įor the sake of example, let's say that the 2 programs in question are xampp.exe and dbserver.exe.