XAMPP (1.8.1) on Windows 8 – Apache not starting as Port 80 “in use by system”

I have recently upgraded to Windows 8 and installed XAMPP 1.8.1. On trying to start Apache using XAMPP Controller, I kept getting an error message saying that Apache could not be started because port 80 (the default port for Apache) was “in use by system”.

After a bit of searching around, one common solution, and the one that worked for me, was to turn off the “World Wide Web Publishing Service”, as follows:

  • Go to Control Panel > Administrative Tools > Services
  • FindĀ “World Wide Web Publishing Service”
  • Right click and select “Stop”
  • Right click and select “Properties”, then change “Startup type” to “Manual”

If this doesn’t fix it, you can find out what is using port 80 as follows:

  • In a Command Prompt, run ‘netstat -ao > netstat.txt’ to write active connections and associated process IDs (PID) to a file (for me, there were too many to just view them in the command prompt)
  • Find the PID that is listening on port 80 (0.0.0.0:80) – for me, the PID was 4, which seems quite common
  • Open Task Manager (Ctrl + Shift + Esc), right click on the column headers, and then click PID to show the PID column. Sort by PID to find the process for the PID that you identified above.

Once you know the process that is causing the problem, a bit of Googling (other search providers are available) should help you fix it.