phptutorials.cjb.net - Free PHP Tutorials and Advice
 

PHP Installation Tutorial 1A - Installing WAMP with I.I.S. - Page 1 of 1

Tutorial Aims

This tutorial is intended to be a guide through the process of installing Apache, MySQL and PHP on a Windows based machine that already has I.I.S. installed. It is not intended to show how to install PHP on I.I.S.

Introduction

If you have IIS installed on your computer when you try to install and run Apache you will probably get an error like the following:

"Only one usage of each socket address is normally permitted. 
:make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shut down"

This is because web servers (like Apache and IIS) listen for requests (‘bind to’) on the default port (port 80) and only one server can bind to each port at a time, IIS gets the port first, so Apache spits out a, rather cryptic, error message and shuts down.

What is IIS and why do I have it?

IIS, or Internet Information Services is Microsoft’s attempt at a web server, it has a reputation for being very buggy, more so than other Microsoft products, and having many major security holes, the rate of release of patches is considered a joke to many net-heads.

If you didn’t install IIS yourself then it was probably installed by default when Windows was installed, this is often the case for Win2K, and if you don’t use it yourself then you may wish to uninstall it.

Solutions

If you have IIS installed then you basically have two options

  1. Uninstall IIS
  2. Configure Apache and IIS to work together

Uninstall IIS

To uninstall IIS try clicking ‘Start > Control Panel > Add/Remove Programs’. It should be listed in the installed programs listing or under ‘Add/Remove Windows Components’.

Configure Apache and IIS to work together

It may not be feasible to uninstall IIS (Someone else’s computer, IIS in use …) but you can configure Apache and IIS to work together. As I said before the two servers conflict because of ports.

Any Port in a Storm

Most people would recognise http://www.domain.com as a web address, what they don’t know is that all web addresses have a port, if that port is the default (port 80) then it is optional (http://www.domain.com:80 would work as well) but if the port is not default then it must be specified (this is known as qualifying the URL) For example if the server is bind to port 8080 then the URL would be http://www.domain.com:8080 just http://www.domain.com would not work.

So for Apache and IIS to both work one must be bind to a non default port, ports 8080, 8008 or 8088 are common choices. So if you don’t use IIS for web hosting then change IIS, and vice versa if you plan to use IIS more than Apache then change Apache.

Changing IIS

Note: I do not have IIS and therefore have been unable to test this section.

  1. Launch the IIS snap-in (Start > Administrative Tools > Internet Information Services).
  2. Expand the console tree to reveal the Default Web Site.
  3. Right-click Default Web Site and choose Properties.
  4. Enter 8080 or other unused port number in the TCP Port text box and click OK.
  5. Restart Apache and see if it now works

To get to IIS hosted pages go to http://localhost:8080/

To get to Apache hosted pages go to http://localhost/

Changing Apache

To Change the default port on Apache

  1. Install Apache as per the tutorial.
  2. Edit 'httpd.conf' ( Start > Programs > Apache... > Configure... > Edit httpd.conf
  3. Search for a line that says 'Listen 80' and change it to 'Listen 8080' ( or what ever port number you choose).
  4. Change line 'ServerName localhost:80' to 'ServerName localhost:8080'.
  5. Then restart Apache.

To get to Apache hosted pages go to http://localhost:8080/

To get to IIS hosted pages go to http://localhost/

Contribute

This article is currently under construction, however I do not have IIS on my computer, if you have IIS and are looking to install WAMP, and would like to help in the writing of this article then please email me .

Copyright

Copyright 2003 Matthew Phillips. Permission is granted to copy, distribute and/or modify this document as long as this notice is included. The original version can be found at http://www.phptutorials.cjb.net/ If you make this text available on your website please notify the author, For details of how to notify the author please go to the aforementioned web site and click on the 'Webmasters' link.