What to do if XAMPP for Windows won’t load anything under localhost
I’ve used XAMPP for Windows on my laptop as a testing server for over a year with no problems. Today, though, I started the Apache and MySQL services as I have many times in the past only to find that both localhost and 127.0.0.1 did not work in my browser. Here’s some of the things I tried that did no good and some notable facts:
- I tried localhost:80 and 127.0.0.1:80 with no effect
- I disabled the Windows firewall. No dice.
- I uninstalled the Apache service. No change.
- I uninstalled/reinstalled XAMPP multiple times with multiple versions. No change.
- When I would put localhost in the browser, I did not receive a "Page cannot be found" error. Instead, the status bar would indicate "Waiting for localhost." I waited more than ten minutes to see if anything would happen at one point. Nothing did: The screen remained white.
- It didn’t matter what browser I used. IE, Firefox, and Opera all sat there and waited while nothing happened.
- I have made no system changes since the last time I ran XAMPP except for the regular barrage of Windows Updates.
While I don’t know exactly what broke my XAMPP installation, I can almost guarantee that a Windows Update killed it. I know Microsoft can’t keep every program under the sun from breaking with its updates, it could do a better job of telling you exactly what each update does without having to dig through 500 lines of the KB articles. Anyway…
I managed to fix the problem, as per this article posted in the Apache Friends forums. In the C:\program files\xampp\apache\bin\httpd.conf file, I added the following line:
Win32DisableAcceptEx
From the best I can tell, this has something to do with Apache’s interaction with Windows’ WinSock 2 API. I’d say some security update managed to fix a problem in WinSock but break Apache. It makes me feel really stupid that I don’t know exactly what caused the problem or exactly how the solution actually fixed it. I’m just glad everything is working now. I can actually get to work on the project I needed the server for in the first place.