Search This Blog

Friday, July 3, 2009

Downloading, Installing and Configuring Apache and php on Windows

1) Downloading

Apache
http://httpd.apache.org/download.cgi
Download -- Win32 Binary including OpenSSL 0.9.8i (MSI Installer)

Php
http://in2.php.net/get/php-5.2.8-win32-installer.msi/from/a/mirror
Download -- in.php.net

2) Installing

Apache
Double click on msi installer and follow the instruction.
Give your machines hostname and domain name when asked.
Finish it.

Php
Double click on php installer and follow the instruction.
Select the apache server when asked form the server list.
Finish it.

3)Configuring

Apache
Write "localhost" in browser - It shows like "It Works"

Now configure the Apache for php Add the lines in httpd.conf (in conf dir)

#Add this line where other LoadModule line are, this is for apache2.2, this dll comes when u installed php, in php folder, check the path as well

LoadModule php5_module "c:/Program Files/php/php5apache2_2.dll"

#DocumentRoot where you php files must be placed
#by default is, and can be changed to desired folder

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

#Add this line where other AddType statements are
AddType application/x-httpd-php .php

#AT the end of file add this, check php path
PHPIniDir "c:/Program Files/php"

Now restart the apache server, double click on
ApacheMonitor.exe
in bin folder of Apache dir, if already start, Maximise it from the Task bars icons

Restart the apache to make changes effective.


make a file php file eg v.php
write in it

phpinfo();

save file in C:/Program Files/Apache Software Foundation/Apache2.2/htdocs, which is default php folder

Now type in browser to get result....
localhost/v.php

No comments:

Post a Comment