Using XAMPP and IIS together – Easy Solution

* This post gets 100’s of hits a week – if you’ve found this article helpful please leave a comment – thanks in advance!*

* UPDATED FOR XAMPP 1.7.5 (November 2011)

If you have IIS installed on your Windows environment and want to run XAMPP (the windows flavour of Apache, MySQL, Perl and PHP) then here’s an easy way for both applications to co-exist.

There are two ways to solve this – either change IIS (the harder way) or change the Apache config (the easier way) – either way you’ll achieve the same thing. Personally I went the Apache route and here’s how I did it (using XAMPP v1.7.1).

(This assumes you just installed XAMPP)

Change the Port Defaults

By default IIS uses ports 80 and 443 for HTTP and HTTPS access respectively (list of ports and what they do here). By default, Apache also assumes these same settings (as does XAMPP). By altering two config files in apache you can easily over-ride this:

For the purpose of this article I’ll assume you installed XAMPP to the default location.

Edit file C:\xampp\apache\conf\httpd.conf

Change line 63 to :

Listen *:81

this tells Apache to listen to all IP addresses on port 81 (you probably don’t need the asterisk but I did. You could also change to another port of choice, e.g. 8080) if you were also using port 81

Change line 175 to:

ServerName localhost:81

Again – if you chose another port, update witht that. Save the file and close.

XAMPP reports the wrong values

When you start XAMPP through the console, it will say starting Apache on port 80. This is just a hardcoded status message it displays; the key piece is that you get a “Running” message through the console.

If you have this all running as a service you can just assume it’s going to work – unless you check the console.

If Apache has a problem with one of the port configs it will tell you. Otherwise, if you don’t get a response and the window appears to be “hung”, apache IS running!

If you’re still getting stuck, try stopping the “World Web Web Publishing Service” (right click “My Computer” > Manage >Services), try accessing http://localhost:81 – if it works you know that IIS and Apache are still clashing.

Addendum pudendum

Thanks to one of my readers who pointed out that XAMP newer versions need a few extra changes:

“just search for the line: LISTEN and modify all of the 80 values, there are only 3 of them) , the same thing for the /extra/ folder”

More XAMPP Changes!

Thanks to JesusCrawls for this update
**Note**: As of 1.7.5 release of XAMPP...there is a MUCH EASIER way to do this.
Go to D:\xampp\install (D: is whatever drive you installed it on, usually C: unless you did a USB install like me)
Look for the file called "portcheck", it is a windows batch file. Double click it.
After the black screen goes away, click the file underneath it, "portcheck", a Configuration setting file. You will now have a list of ports on your machine that you can use for XAMPP!
Worst case, type CMD into the windows search on the desktop and put in: netstat -abno
This will give you a list of all ports in use, whats using them and a process ID that can be cross-referenced to task manager's PID column. Try ending the processes/services using the port and run XAMPP again.

Many Many Many thanks. Lots of love. I ran into another hiccup that I can’t seem to figure out. Running
(Start > Run > type “cmd” > type “cd c:\xampp\apache\bin” > type “httpd“)
results in a (OS 10048) error [Only one usage of each socket address (protocol/network address/port) is normally permitted.
All seems to function ok in my browser – problem I run into is
(( I’m trying to move a blogger blog to a wordpress using [ http://www.devilsworkshop.org/moving-from-blogger-to-wordpress-maintaining-permalinks-traffic-seo/ ] documentation))
when I utilize wordpresses import functionality it makes a request to google using ssl and returns the following error:
((
Could not connect to https://www.google.com
There was a problem opening a secure connection to Google. This is what went wrong.
Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP? (131299200)
Thank you for creating with WordPress yadda yadda ya.
))
Xampp backed reports ssl is working fine :(:(

This is way beyond me i’m afraid – perhaps Proximotron (http://homepage.usask.ca/~ijm451/prox/) might help you examine the HTTP requests going in and out to determine where it’s failing. I think XAMPP presumes all connections are localhost so I dont know if you can point it to another resource…

hi paul,
very clean & clear article..
I gone though ur steps and the end when try forhttp://localhost:81/
its give me following error…
I use vista os i can’t get it whts wrong with that, Please help me
thanks

error that i get
—————————-
Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try again

Great post, works a treat to get apache working. I have one problem though! phpmyadmin appears to still be using the install I have on my windows box. Does anyone know how I can get it to point at the xampp install – I have installed xampp on a pendrive. Many thanks!

Hi Paul
I followed your instructions but
when i type the httpd command into cmd I am getting an error
httpd : Syntax error on line 460 of C:/xampp/apache/config/ httpd.conf: httpd : Syntax error on line 17 of C:/xampp/apache/config/extra/httpd-xampp.conf: Cannot load c:/xampp/xampp/php/php.dll into server the specified module could not be found…..

C:\xampp\apache\bin>httpd
httpd: Could not reliably determine the server’s fully qualified domain name, us
ing 59.161.191.191 for ServerName
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Hi ,after having a fight with my XAMPP (alot of screaming involved) i found this article and was really helpful!
One thing though, the tutorial is out-dated, for XAMPP 1.7.3 there are other lines to modify then the ones you specified but it’s pretty easy to figure out what to modify (just search for the line: LISTEN and modify all of the 80 values, there are only 3 of them) , the same thing for the /extra/ folder. :)

Hi paul i’m having problems to run xampp with iis 6.0, I already changed the port to 8080 and the ssl port to 443.
I can run xampp in localhost but i can’t access via internet, i can ping the port form outside.
any ideas?
thanks

That’s helpful – i’m about to install xampp on a different system to the one i installed it before and only have a fragmented recollection of how to do it. I’m dreading something going wrong and having to spend hours if not days working out how to get things back to how they were!!!

You will now have a list of ports on your machine that you can use for XAMPP!

Worst case, type CMD into the windows search on the desktop and put in: netstat -abno

This will give you a list of all ports in use, whats using them and a process ID that can be cross-referenced to task manager’s PID column. Try ending the processes/services using the port and run XAMPP again.

for me https://localhost or https://127.0.01 shows web page not available, though http://localhost works just fine(loads XAMPP console). My question is how to get HTTPS to work? I have already changed the SSL port in httpd-ssl.conf from 443 to 442…:(

There is the config file xampp/apache/conf/extra/httpd-ssl.conf which contains all the ssl specific configuration. The files starts with , so it only has an effect if the apache has been started with its mod_ssl module.

Open the file xampp/apache/conf/httpd.conf in an editor and search for the line

#LoadModule ssl_module modules/mod_ssl.so
remove the hashmark, save the file and re-start the apache.
adldap needs php’s openssl extension to use “ldap over ssl” connections. The openssl extension ships as a dll with xampp. You must “tell” php to load this dll, e.g. by having an extension=nameofmodule.dll in your php.ini
Run

echo ‘ini: ‘, get_cfg_var(‘cfg_file_path’);
It should show you which ini file your php installation uses (may differ between the php-apache-module and the php-cli version).
Open this file in an editor and search for

;extension=php_openssl.dll
remove the semicolon, save the file and re-start the apache.

I got problem with installing joomla 1.7 on my window server 2003 IIS. It stuck on the first page of the installation which is “choose language”. I have installed XAMPP 1.7.3 on my server and configured according to your instruction. Can anyone help me to solve the problem? Thanks a lot!

Thank you, very helpful. i manage to run iis and xampp together in window 7. but now i struggling try change localhost:81 to domain name. i refer some article but it’s still didn’t work. may be lost some step. please help

Hi I’m just about to set up a webserver using IIS 7+ and found your page here. I have run xampp in the past and liked it pretty well. My question is, what would be the benefit of running ISS and xampp together? Thanks.

You can run PHP in IIS (http://php.iis.net/) – there’s no massive benefit in a dev environment, but XAMPP has a great suite of tools that work together pretty well and is a good go-to when you’re working x-platform (e.g. OSX).

For a production environment, i think most ppl prefer Apache with all the mods you can do and is anecdotally more secure.