Apache Setup:

1. Download Apache installation from http://httpd.apache.org/download.cgi ( apache_2.2.9-win32-x86-no_ssl-r2.msi) http://www.ibiblio.org/pub/mirrors/apache/httpd/binaries/win32/apache_2.2.9-win32-x86-no_ssl-r2.msi
2. Install by double click on .msi file
3. Leave default values.
4. verify setup by invoking http://localhost/

PHP Module Setup:

5. Download php package using http://www.php.net/downloads.php#v5 (http://us.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror)
6. Double click on php-5.2.6-win32-installer.msi to start installation
7. Provide the directory name “example: C:\Ajay\Installed Programs\PHP\
8. Click Next and select Apache webserver (2.2.x)
9. Click Next and provide directory of apache Directory (by default its C:\Program Files) i used “C:\Ajay\Installed Programs”
10. Click Next and let it finish the setup
11. On completion it will prompt an error saying “Configuration failed you need to modify httpd.conf manually”
12. httpd.conf can be found under C:\Ajay\Installed Programs\Apache Software Foundation\Apache2.2\conf
13. Add following lines somewhere underĀ  “LoadModule ” statements ends somewhere after line 128
LoadModule php5_module “C:/Ajay/Installed Programs/PHP/php5apache2_2.dll”
14. Add following lines under <IfModule mime_module> section somewhwre after existing line 386 “AddType application/x-gzip .gz .tgz”
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
15. Stop Apache server and Start again.

Test PHP Page:

16. Create test.php file under C:\Ajay\Installed Programs\Apache Software Foundation\Apache2.2\htdoc with following content

17. test php file using http://localhost/test.php in browser. You should able to see output.

Note: if for any reason you are not able to star tapache then please start apache using command line ..
example: Go to command prompt. -> change directory to apache bin > execute command “httpd.exe” (you should able to see error in case of any)