Apache and PHP on Windows XP

A quick guide to installing Apache and PHP on Windows XP.

  1. Setup PHP

    1. Download PHP from php.net. If you want the latest stable version then it’s currently the PHP 4.3.7 zip package (6,895Kb). Unpack to a folder - say, C://PHP
    2. Copy all the dlls in C://php/dlls to C://WINDOWS/SYSTEM32
    3. Copy C://php/php4ts.dll to C://WINDOWS/SYSTEM32
    4. Copy C://php/php.ini-dist to C://WINDOWS and rename it php.ini
    5. Edit C://WINDOWS /php.ini and change the extension_dir line to read:
      extension_dir = "C:/php/extensions"
  2. Setup Apache

    1. Download Apache from apache.org. You’ll want the Win32 Binary (MSI Installer). Run the installer, take the defaults.
    2. Open the Apache config file C:// Program Files/ Apache Group/ Apache2/ conf/ httpd.conf in notepad
    3. Find the section with lots of ‘LoadModule’ directives and at the end of that section add another line that reads:
      LoadModule php4_module c:/php/sapi/php4apache2.dll
    4. Find the line that says:
      DirectoryIndex index.html
      and change it to read
      DirectoryIndex index.php index.html
    5. Find the section that has a line like this:
      #AddType application/x-tar .tgz
      and insert after it this line :
      AddType application/x-httpd-php .php

Restart Apache and you’re done. There’s a lot more to configure in a development environment but this will get you up and running.

One Comment

  1. rich gormley
    Posted February 8, 2006 at 12:02 am | Permalink

    this was helpful this was helpful

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*