Cannot start Apache server on XAMPP. Port 80 blocked by PID 4!
[SOLVED]

[SOLVED] Cannot Start Apache Server On XAMPP. Port 80 Blocked By PID 4!

I recently upgraded my work computer from a Windows 7 system to a Windows 10 64 bit high-performance rig.

As my work primarily involves web-development hence one of the first things I had to set up on my new system was web-server, MySQL database, and the ilk. I have, for years, been using the XAMPP pack for my LAMP stack so that is what I installed on my new system too.

But, to my surprise, when I fired it up for the first time,  the Apache server failed to start!

couldnot start apache server port 80 blocked by PID 4
Cannot start apache server port 80 blocked by PID 4

Apache server port 80 blocked by PID 4 on Windows 10 – XAMPP

The first thing I did when I saw this error was to fire-up the Taskmanager and try and stop the process with PID 4. That, however, did not work.

SOLVED – XAMPP Apache Server Port 80 blocked by a process with PID 4

This is how I finally solved the issue and managed to run my Apache server again, on port 80.

First, from under your Start menu, go to run and then type the following and hit Enter.

services.msc

This should bring up the Windows Services Management Console. Here, look for the process with the name World Wide Web Publishing Service

Service with PID 4 in Services.msc

Find the service with PID 4 in Services.mscYou can stop it by going to the Properties menu item that you get when you right-click on the process.

Now, try starting your Apache server through XAMPP and this time, the server will start running successfully on port 80.

 

stop the service with PID 4
Go to properties of the service

But, the problem will occur again when the computer restarts.

So, in order to stop running this process even after a restart, I had to do a couple of more steps as below:

Stop the service with PID 4
Stop the service with PID 4

Along with stopping the process, also select the Disabled option from the Startup type dropdown menu. This will ensure the process does not start again on a system restart, thereby blocking the port 80 which Apache webserver uses to run as that is the default port for HTTP requests.

solved disabled port 80 by PID 4
Click Apply and then OK to save the setting

That’s it!

Bonus tip

Another way of making sure the Apache web server runs successfully, without doing the things I have mentioned above is to edit the httpd.conf file and look for the line where it says Listen 80. The 80 here is the port number which the process with PID blocks.

You can simply change the apache listening port number here from 80 to something else like, 8080 and then save the file.

Then try starting the Apache server and it would run successfully this time!

Share This Post

Subscribe To my Future Posts

Get notified whenever I post something new

More To Explore

How To Use Google SIgn In In Flutter
Blog

How To Use Google Sign In Flutter?

This topic is divided into 2 parts. The parts are as follows: 1 – Creating a Firebase Project 2 – Configuring the Flutter app and