Wrapcode

Solve IIS and XAMPP / WAMPP conflict without changing ports

| 3 min read

IIS and XAMPP

Solve IIS and XAMPP Conflict without changing ports

I use IIS and XAMPP for in order to develop ASP.NET and PHP applications simultaneously. I have been using XAMPP since long time for PHP app development. I have moved to Windows Azure Development and ASP.NET MVC recently. In order to understand the exact request pipeline in ASP.NET and to learn other features of IIS, I installed it on my system which reserved port 80. After some days, I wanted to work on my blog theme. I started XAMPP and started Apache server. Apache server couldn't start because port 80 was already blocked by IIS server.. This is what I error log said

> 6:49:49 PM [Apache] Status change detected: running > 6:49:51 PM [Apache] Status change detected: stopped > 6:49:51 PM [Apache] Error: Apache shutdown unexpectedly. > 6:49:51 PM [Apache] This may be due to a blocked port, missing dependencies, > 6:49:51 PM [Apache] improper privileges, a crash, or a shutdown by another method. > 6:49:51 PM [Apache] Check the "/xampp/apache/logs/error.log" file > 6:49:51 PM [Apache] and the Windows Event Viewer for more clues

Fix IIS and XAMPP Conflict - The solution

I tried playing with ports, it worked very well. Although changing port works like charm, I didn't wanted to change port of either of the server. Instead I wanted something to do that will keep both the servers intact on same port. Since I don't work on both the servers simultaneously, I found this idea better. Here's what I have done -

  1. Close XAMPP.
  2. Start Internet Information Services (IIS) Manager
  3. On the right sidebar under Actions label, click STOP
  4. Close IIS Manager
  5. Start XAMPP and run the service again.
  6. This time, service will not stop itself since port is open for use.

What happened behind the scene?

Generally, when we run Apache service, it blocks port 80. In this scenario, port 80 is already blocked by IIS server. When we run XAMPP (Apache Server to be specific), it tries to block port 80 for use. Since IIS Server has already blocked it Apache doesn't find it open. When we stop IIS server, the port becomes available again and Apache can successfully block it for it's use. The solution is pretty straight forward but rookies can find this problem pretty hectic if they don't know what is happening behind the scenes.

Limitation

Since we are blocking a port either by IIS Server or Apache, we are not letting the other use it. If you want to work on either any of the server at one time, this solution is a best workout. If you are planning to work on Apache (say PHP application) and IIS server (Say, ASP.NET application) you will have to change port of either one.