Using XAMPP and IIS together – Easy Solution

(this is becoming a popular post, so if you like it please let me know)

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 thie – either change IIS or change the Apache config – 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):

Change the Port Defaults

By default IIS uses ports 80 and 443 for HTTP and HTTPS access respectively. By default, Apache also assumes these settings. 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 gets apache listening to all IP addresses on port 81 (you probably don’t need the asterisk but I did for safeties sake. You could also change to another port of choice, e.g. 8080)
  • Change line 175 to:
  • ServerName localhost:81
  • Again – if you chose another port, update witht that. Save the file and close.
  • Edit file C:\xampp\apache\conf\extra\httpd-ssl.conf
  • Edit line 42 to:
  • Listen 442
  • This changes the SSL (HTTPS) port to 442 (or again, your port of choice).

That’s it!

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.

Proof of the pudding – testing XAMPP

Go to http://localhost:81

If all’s well you’ll see the XAMPP Logo; if not, check you updated the configs to use ports that are not already in use. You can also see what apache thinks of your install:

Go to Start > Run > type “cmd” > type “cd c:\xampp\apache\bin” > type “httpd

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.

23 Responses

  1. this is exactly what I was looking for, I needed to have xamp and IIS work together for a project I am working on. Will test this and get back to you with feedback.

  2. I finally found a place with clear solution. Everybody will tell you to change port from 80 to 81. But that is not enough” You MUST ALSO change port 443 and then everything work out of a box.

    Thank you Paul!

  3. 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 :( :(

  4. Thanks for the quick reply Paul!! The strange thing is that Apache is running (as far as I can tell) even with the port error. (OS 10048)

    I’ve tried changing to various ports by modifying the files according to your instructions. Each time I receive the (OS 10048) error.

    I should apologize I’m new at this and I’m not much of a coder. My problem is probably going beyond the scope of this article as well.

    Here’s the skinny:

    I’m located in China – blogger is blocked so I’m using freegate as a proxy (as far as I’m concerned this is a magic box that “tunnels” and masks my IP)

    Local machine is running XP SP3 hence the need to use your post to get Xampp up and running with the port changes.

    This is probably a stupid question but is it possible/necessary to configure how Xampp connects to the internet (can I push it through a proxy)?

    BTW uncommenting the php.ini line does eliminate the ssl error however I bump into another hiccup:

    [[ wordpress reports "We were not able to gain access to your account. Try starting over." when trying to import from blogger]]

    I’m trying to deduce if its coming from wordpress, blogger/google, or my local machine configuration.

    *endless tears of frustration* :(

    Thanks as always – for any intelligence you can bestow on me!!

  5. thanks a lot man… it works

  6. hi paul,
    very clean & clear article..
    I gone though ur steps and the end when try for
    http://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

  7. really nice post, it really help me , thanks a lot, best of luck friend :)

  8. Thanks a lot paul. After so many hours of frustration it went fine with ur solution. Again thanks.

  9. 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!

  10. 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…..

    would this make sense to you or anybody

    Many thanks
    Lee

  11. Thank you so much! That worked perfectly for me.

  12. C:\xampp\apache\bin>httpd
    httpd: Syntax error on line 122 of C:/xampp/apache/conf/httpd.conf: LoadModule t
    akes two arguments, a module name and the name of a shared object file to load i
    t from

    help me…

  13. 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

  14. Thank you very much for a clear, concise and effective solution

  15. Glad to be of help – it did seem that there were too many ppl making it harder than it needed to be – Esp. the MS haters :)

  16. 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…

  17. check out this thread:http://www.wampserver.com/phorum/read.php?2,43686

  18. So it sounds like PHP is choking – can you even serve HTML from apache? Either way this just sounds like a bit of googling might help. Sorry.

  19. it’s out of the scope of my article to assist with this; but from your previous comment you either solved it yourself or you used Google. I think the latter might be a great place to start.

  20. This is a SOAP issue, not a XAMPP issue. Plus, when was the “Hello World” ever an urgent webservice? :)

    To answer your question – see http://www.apachefriends.org/f/viewtopic.php?f=16&t=37170

    If I can find it on google…

  21. You didn’t read the article properly by the looks of it cause it’s still pointing to port 80. Read FAIL :)

Leave a Reply