php – XAMPP Port 80 in use by Unable to open process with PID 4

php – XAMPP Port 80 in use by Unable to open process with PID 4

Simply set Apache to listen on a different port. This can be done by clicking on the Config button on the same line as the Apache module, select the httpd.conf file in the dropdown, then change the Listen 80 line to Listen 8080. Save the file and close it.

Now it avoids Port 80 and uses Port 8080 instead without issue. The only additional thing you need to do is make sure to put localhost:8080 in the browser so the browser knows to look on Port 8080. Otherwise it defaults to Port 80 and wont find your local site.

So I have faced the same problem when trying to start apache service and I would like to share my solutions with you.
Here is some notes about services or programs that may use port 80:

  1. Skype: skype uses port 80/443 by default. You can change this from tools->options->
    advanced->connections and disable checkbox use port 80 and 443 for addtional incoming connections.
  2. IIS: IIS uses port 80 be default so you need to shut down it. You can use the following two commands
    net stop w3svc
    net stop iisadmin
  3. SQL Server Reporting Service: You need to stop this service because it may take port 80 if IIS is not running. Go to local services and stop it.

These options work great with me and I can start apache service without errors.

The other option is to change apache listen port from httpd.conf and set another port number.

Hope this solution helps anyone who face the same problem again.

php – XAMPP Port 80 in use by Unable to open process with PID 4

Your port 80 is being used by the system.

  1. In Windows “World Wide Publishing Service is using this port and its process is system which PID is 4 maximum time and stopping this service(“World Wide Publishing) will free the port 80 and you can connect Apache using this port. To stop the service go to the “Task manager –> Services tab”, right click the “World Wide Publishing Service” and stop.
  2. If you dont find there then Then go to Run > services.msc and again find there and right click the “World Wide Publishing Service” and stop.
  3. If you didnt find “World Wide Publishing Service” there then go to Run>>resmon.exe>> Network Tab>>Listening Ports and see which process is using port 80


And from Overview>>CPU just Right click on that process and click End Process Tree. If that process is system that might be a critical issue.

Leave a Reply

Your email address will not be published.