Sunday, August 12, 2007

Apache 2, PHP 4 & PHP 5 on Windows XP


This is a comprehensive guide to installing and running Apache 2.2.4 with PHP 4.4.7 and PHP 5.2.3 on Windows XP. It covers all of the steps in detail with lots of screen grabs so you can follow the process visually.


Update: The guide has been updated for PHP 5.2.3. I have also created a new forum here. Please use it if you run into trouble following this guide, I'll be only too happy to help. You don't even need to register to post.


The Guide


I know that the number of sections looks daunting, but that is because I have split the guide up into small manageable chunks. It shouldn't take you longer than a couple of minutes to complete each section.



  1. Downloads

  2. Configure Windows XP for PHP

  3. PHP 4 Settings

  4. PHP 5 Settings

  5. Create a local web site

  6. Setting the Environment Variable

  7. Install Apache

  8. Install the Apache2 Handler

  9. httpd.conf

  10. Creating a Virtual Host

  11. system32/drivers/etc/hosts

  12. Bring Apache to life

  13. Switching to PHP 5


Useful Extras



  1. Adding another web site (detailed version)

  2. Adding another web site (short version)

  3. Build a PHP 4/5 switcher

  4. Run PHP 5 as a module and PHP 4 as CGI together


Troubleshooting



  1. Apache won't start

  2. Your guide doesn't work

  3. They've just released a new version of PHP! Now what?

  4. Can't you just do it for me?


Don't be disheartened by the length of the guide! There is no reason why you can't complete the entire process in under 30 mins, and you'll be rewarded with a versatile and feature-packed local development environment as your reward.


Who is this guide aimed at?


Everyone who posts in php-general / forums asking how to get PHP and Apache running on Windows so they can develop and test locally. Often they'll hit simple but annoying problems that can be easily fixed. I also wrote this as an alternative to using a 'WAMP' installer. Teaching yourself how to install and configure PHP/Apache is a very useful set of skills to have, and well worth adding to your knowledge set.


User Feedback


Since releasing this guide I've received some great emails from people who've had success with it. Here are some of my favourite quotes: "Thank you for your VERY helpful instructions! This point on I can now learn PHP a lot better on my own computer. Cheers!" (Patrick) - "I very much appreciate your guide - you made it really easy" (Terry) - "Richard, this is truly the best guide to setting up php and apache i've seen online. Thank you so much." (Edward) - "Thanks for the great and detailed guide" (Thijs). "Thank you very much for the php guide you spent a lot of hard work to make, the guide covered everything, screenshots, alternatives as well as any possible errors and was precise and right to the point, and because of it i finally have php installed on my computer and i can learn it more conviniently." (Gaurav)


Thanks guys :) BTW all the feedback I have received so far has been incorporated into the guide. Feel free to use the new forum (see below) to send your comments / suggestions.


WAMP Guide Forum


Need help on a more 'interactive' level? Then why not use the WAMP Guide Forum. Post any questions or problems you may have. You don't even need to register to join. We'll help you as much as we can.

1 comment:

Chrisranjana.com software said...

Good one.. Must be pretty usefull for someone wanting to install apache and php

Developers in India