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.
  • 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! *** XAMP 1.7.3 changes – see bottom of post

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.

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.
About these ads

75 thoughts on “Using XAMPP and IIS together – Easy Solution

  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. 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 :)

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

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

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

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

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

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

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

  12. cant find php.ini in C:\xampp\apache\bin why so…

    and while running https://localhost/hw/ZeroWebserviceclient.php on browseriam getting following error

    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘http://localhost/WebServiceTutorial/ZeroWebservice.wsdl’ : failed to load external entity “http://localhost/WebServiceTutorial/ZeroWebservice.wsdl” in C:\xampp\htdocs\hw\ZeroWebserviceClient.php:3 Stack trace: #0 C:\xampp\htdocs\hw\ZeroWebserviceClient.php(3): SoapClient->SoapClient(‘http://localhos…’) #1 {main} thrown in C:\xampp\htdocs\hw\ZeroWebserviceClient.php on line 3

    ZeroWebserviceclient.php code as below

    sayHelloWorld(‘User’);
    print_r($return);
    ?>

    help me please its urgent

  13. it’s a little out of reach of this article …. 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.

  14. Thanks a lot for this helpful post! I was smart enough to find a reference in error.log to port 443 but I couldn’t find that referenced in httpd.conf so I was stuck.

    Your post told me exactly what I needed to get XAMPP working on my WinXP system!

  15. 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. :)

    Thanks Paul !

  16. Thank you so much! I’m trying to install Joomla on my laptop and this was the simplest explanation with (so far) perfect results.

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

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

  19. Great article…solved my port issues clearly and quickly! So I’d like to add:

    **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 go 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.

    Never quit!

  20. Here’s your answer: StackOverflow

    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.

  21. i stuck at the first page (choose language) while i was trying to install joomla in my server. please advise. many thank!

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

  23. thanks alot for the post :), helped me alot,
    one thing i had to do extra is to enable Apache 2.2 from services.msc.

  24. For windows thats an option that should come up as part of the install process; there is documentation within XAMPP to help manually do this later.

    Thanks for the comment!

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

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

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s