July 10, 2006

Setting up a PHP Development Environment - Part 1: Installing Apache

You will find other articles relevant to this document in these sections:
Richard Lee @ 5:23 pm

Welcome to Part 1 of our 3 part series, “Setting up a PHP Development Environment”. Please note we will be using a Windows XP environment for our installation. If you have come here in search of an article on how to install PHP please refer to Part2: Installing PHP4.
Requirements :

  • Windows NT i.e. XP (NT 4.0 has some issues with SP 4 please update to SP 6)
  • TCP/IP networking must be installed and working
  • Intel/AMD Processor (for Win Installer)

Installation & Setup
1. Download the Win32 Binary (MSI Installer) for the Apache HTTP Server package from apache.org .
Note: I am using the 2.0.58 release however 2.2.2 is now available.

2. Run a virus check and MD5 checksum to verify the integrity of the download, then run the installer.
2. Within the Installation Wizard enter the following Server Information, making sure you check the checkboox “For All Users, on Port 80, as a Service” at the bottom.
Apache dialog - Enter Server Info

Network Domain: localhost
Server Name: localhost
Admin Email: (your email)

Note: If you get a Windows Firewall prompt, make sure you select UNBLOCK

3. Install to your local drive. Mine is C:/Apache2 and we will assume this directory in the following installment Part 2: Installing PHP.
4. After installation has completed the Apache Monitor will appear in your Windows task bar. Right-click this and select Start from the menu. The server should start loading.

Apache Monitor

5. After the server has started, open your web browser and visit http://localhost. An Apache test page should come up - You have now successfully installed the Apache Server on your machine.

Apache Test Page

Note: If there is an error, check the Apache Monitor to make sure the server is running, if not check your Firewall to make sure the service isn’t blocked.

6. (Optional) Apache defaults your document root to [drive]:/[Apache]/htdocs , if you would like to specify a different root directory open up the httpd.conf file ([drive]:/[Apache]/conf/httpd.conf) and replace the DocumentRoot with the path to your desired directory.

Follow on Part 2: Installing PHP4

For more information on installing Apache please see apache.org’s documentation Using Apache with Microsoft Windows

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • Furl
  • Reddit
  • YahooMyWeb

6 Comments »

  1. Good overview of the install under windows. :-)

    Also be aware you can setup Apache as a Service for Windows NT style OS. From a command line in the Apache/bin folder run the following command:
    apache -k install

    This will allow you to run your services using the “Windows Services” tools running from within the Administrative Tools in your control panel. You can then setup whether to start the service when you first start your OS. You can also then manage you IIS instance and Apache from within that tool set (eg, switch between the two).

    A great supplement to this article is the “Using Apache with Microsoft Windows” located on the Apache website at this url: http://httpd.apache.org/docs/2.0/platform/windows.html

    Also be weary of whether you have an IIS server running already on port 80 as it may cause a fight for who serves user requests. Often Apache will not start if this is the case. To find if IIS server is running on your computer, load the Windows Services from Control Panel > Administrative Tools and find IIS Admin. It will have a status whether it is “Started” or “Stopped”. Stop the IIS Admin to turn off your local SMTP and IISWWW Server.

    Comment by Cameron Manderson — July 10, 2006 @ 5:42 pm

  2. Also for the sake of internal linking to other articles that may be relevant to your search:

    Quick Installation of Apache / PHP / MySQL and FTP tutorial for Windows/Linux and Mac OSX
    http://www.melbournechapter.net/wordpress/system-administration/cman/2006/04/21/quick-apache-php-mysql-ftp-install/

    Comment by Cameron Manderson — July 10, 2006 @ 6:01 pm

  3. Just to follow up on Cam’s point about making Apache run as a service, checking “All Users, on Port 80, as a Service” in Step 2. will have done this for you automatically. However if you have specified to install for yourself only, you can manually register Apache as a service after the installation using apache -k install in the command line.

    Comment by Richard Lee — July 10, 2006 @ 11:32 pm

  4. I have typically liked to install separate application resources into a central spot on your computer, such as C:\server\Apache or whichever. You can then install other bits and pieces contained to that directory, like ANT, PHP, MySQL and the like. It stops things being spread across your whole computer, but seperates it from the Program Files directory which I tend to avoid.

    Comment by Cameron Manderson — July 12, 2006 @ 9:35 am

  5. […] Part 2 assumes you have a working installation of Apache 2.0 please refer to Part 1: Installing Apache if you haven’t already done so. […]

    Pingback by melbourne chapter » Setting up a PHP Development Environment - Part 2: Installing PHP4 — July 25, 2006 @ 2:26 pm

  6. […] Welcome to the final installment of our 3 part series “Setting up a PHP Development Environment”. For those of you who haven’t installed Apache or PHP please checkout Part 1: Installing Apache and Part 2: Installing PHP4 tutorials on our site. Setting up our Database Server… […]

    Pingback by melbourne chapter » Setting up a PHP Development Environment - Part 3: Installing MySQL — September 5, 2006 @ 11:20 am

RSS feed for comments on this post. TrackBack URI

Leave a comment