DIGIT-ARC read-only archive · snapshot: July 23, 2026

Installing Apache, PHP on Windows

26 posts · originally from https://geek.digit.in/community/threads/installing-apache-php-on-windows.6270/

Deep
Deep Original post #1
Mar 1, 2005 at 12:45 AM
I checked this post few mins back, thouht I should write some basic tutorial for installing web server on windows machine..

here is go...

Install Apache

Download Apache from Apache website: *httpd.apache.org/download.cgi

Download this one

Win32 Binary (MSI Installer)

Run the exe file...

Follow the instructions...
Wait for it to finish...

Once it is done...
Test it by typing *localhost/ in your web browser

it should show somehting like

Seeing this instead of the website you expected?
This page is here because the site administrator has changed the configuration of this web server. Please contact the person responsible for maintaining this server with questions. The Apache Software Foundation, which wrote the web server software this site administrator is using, has nothing to do with maintaining this site and cannot help resolve configuration issues.

Done, this mean it is working...

I know, I know, you must be thinking where the hell is www directory...

by default it is stored in

C:\Program Files\Apache Group\Apache2\htdocs

Replace C drive with youur default drive...

You can place the files you want to show it on the server..

I would suggest that you shall change the path of default www directory to some other drive..

the reason for this being, sometimes virus may currept default windows drive...and sometimes even autmatically format the drive too

so it is better to keep the dir in differenr drive..

to change location of the www directory, do this..

Start - Prog Files - Apache HTTP Server.... - Configure Apache Web Server - Edit the Apache httpd.conf Configuration File

Open the file..

Search for DocumentRoot

replace the path with the path you want...

done...

restart the server....

Start - Prog Files - Apache HTTP Server.... - Control Apache Web Server - Restart

done...

So you got apache working fine with your new www directory...

let's move on to PHP

Download PHP from PHP website: *www.php.net/downloads.php

Download PHP 4.x.xx installer

Once you have downloaded it...
While installing select Advacned Mode

and there you will see option something like Display Notice, Warning etc...

Select Display All Errors (No need to display warnings and notice)

In the end from server list select Apache

It will show some alert box..
click on ok....

all done ?

Nah one thing left...

Now you will need to edit httpd.conf file to get php working

nothing much to worry, pretty simple...

For CGI based php

Code:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

add above lines into the httpd.conf and then restart the apache

if you have installed php 5 then you will need to point replace last line with this

Action application/x-httpd-php "/php/php-cgi.exe"

Edit: Thanks to kalpik for this.

You can also install php as apache module..for that you need to add follwoing code in httpd.conf instead of above mentioned one...

Code:
# For PHP 4 do something like this: 
LoadModule php4_module "c:/php/php4apache2.dll" 
AddType application/x-httpd-php .php 

# For PHP 5 do something like this: 
LoadModule php5_module "c:/php/php5apache2.dll" 
AddType application/x-httpd-php .php 

# configure the path to php.ini 
PHPIniDir "C:/php"


now to check whether PHP is installed or not,make one php file and see...

you can use this code

Code:
<?php
phpinfo();
?>

save it as index.php and save it in your www directory...

it should show file with php information...

all done :)

I hope you guys found it easy....

I have not checked it for spelling mistakes coz writing in hurry so please excuse me for that ;)

cheers
Deep
S
sunnydiv #2
Mar 1, 2005 at 1:52 AM
edited
S
Mar 1, 2005 at 9:35 AM
One-shot Installer for Apache, MySQL, PHP..

Things are that easy these days.. Good tutorial though for..
Deep
Deep #4
Mar 1, 2005 at 9:46 AM
well, there will be one installer for anything, but installing one by one properly will be much better...

coz here you get options to customize and install the version you want (Apache 2 or 1.3, PHP 4 or 5)

cheers
Deep
S
Mar 1, 2005 at 10:58 AM
Deep said:
well, there will be one installer for anything, but installing one by one properly will be much better...

coz here you get options to customize and install the version you want (Apache 2 or 1.3, PHP 4 or 5)

cheers
Deep

Ya thats very true.. agreed :)
hard_rock
Mar 2, 2005 at 1:21 AM
Heyyyyyyy!!!! Thnx Dude I needed this.Will u plz tell me how to configure MySQL in apche like the above tutorial.
By the way, I wud like to remind all of the readers tht Apache is given in Feb Digit CD.PHP also given in Jan(Not so sure)
Deep
Deep #7
Mar 2, 2005 at 1:33 AM
Mysql is too simple..

run exe file...
then go to bin folder inside mysql folder

clikc on winmysqladmin.exe

it will start the mysql as well as add it in the services also...

to manage mysql...get PHPmyadmin...

feel free to shoot your queries :)
cheers
Deep
D
Mar 4, 2005 at 11:11 AM
k
guys that's good try
but can any one tell me how to run servlets & JSP's on apache.
hard_rock
Mar 7, 2005 at 11:16 PM
Hi Deep thnx 4 Mysql help.
criptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
I think here there is a spelling mistake.When I entered the above code it showed an error tht this command (criptAlias) is invalid.I got it corrected by PHP documentation.It is scriptAlias.
Deep
Deep #10
Mar 8, 2005 at 12:07 AM
hard_rock said:
Hi Deep thnx 4 Mysql help.
criptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
I think here there is a spelling mistake.When I entered the above code it showed an error tht this command (criptAlias) is invalid.I got it corrected by PHP documentation.It is scriptAlias.

aah i missed that S lol

Fixed it :)

demoninside, i havent tried tomact yet on windows...i will try it sometime...


Deep
R
rajzoo1 #11
Apr 18, 2005 at 4:13 PM
What is the main purpose of Apache....Can I host/run my website from my own desktop computer using Apache web server......I am confused
R
rajzoo1 #12
Apr 18, 2005 at 4:20 PM
What is the main purpose of Apache....Can I host/run my website from my own desktop computer using Apache web server......I am confused
hard_rock
hard_rock #13
Apr 22, 2005 at 4:31 PM
Ya you can do that....For that u must have 24x7 broadband connection.
Also ... There is a notable package which contains Databases,Server,PHP n all tht.
It is Apache2triad.
It includes:
Servers:

Apache

MySql

OpenSSL

Xmail

SlimFTPd

Also postgre SQL
-------------------

Interpreters:



PHP

Perl

Python

TCL

Checkout:
*apache2triad.net/info.php

Its very useful for developers.Its around 70MB I think.So it may be heavy to download it.Anyways 4 information....
It is provided in Apr. PCQuest.
rohan
rohan #14
Apr 23, 2005 at 2:53 PM
[thanX] a lot. I was looking for this quite long. Now only if someone allows me to host PHP for free...
C
Jun 8, 2005 at 7:16 PM
why r u looking for a host if you are the host ???

anyway, the tutorial is very comprehensive and well made.
G
go4inet #16
Jun 12, 2005 at 8:25 AM
My Recommendations :

WAMP : *www.wampserver.com/en/
XAMPP: *www.apachefriends.com/en/

You will really thank me. Both helps good :) The first one is just for Windows. The second is for ppl who wanna install for Windows,MacOSX,Linux.
P
Jun 12, 2005 at 4:44 PM
man.. did all that an got phpBB running.. lolz.. only nobody outside can access it coz of NAT in Sify bband..
was fun tho.. nice
kalpik
kalpik #18
Jul 8, 2005 at 7:40 PM
Hi! Even i have sify but ppl form outside can access my phpBB!!
kalpik
kalpik #19
Jul 8, 2005 at 7:46 PM
Deep said:
Code:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

Hi!

Yor are installing php as a cgi-script. I strongly recommend installing php as an Apache module using the following lines in httpd.conf

Code:
# For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2.dll"
AddType application/x-httpd-php .php

# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

This way its much more secure and uses less resources cause another process of php is not created apache itself does all the processing.

Regards!

Kalpik
Deep
Deep #20
Jul 8, 2005 at 7:51 PM
nice suggestion...
let me edit the thread and add it there..

Deep
kalpik
kalpik #21
Jul 8, 2005 at 7:56 PM
Deep said:
Download Apache from Apache website: *httpd.apache.org/download.cgi

Download this one

Win32 Binary (MSI Installer)

Run the exe file...

Hehe! its an msi file! not exe! :p

Kalpik
cooljeba
cooljeba #22
Jul 9, 2005 at 12:27 PM
on my machine i have used IIS rather than Apache. I feel it is much easier to configure IIs when compared to Apache.
Thanks for this A[ache tutorial deep. :D

..:: peace ::..
Jeba
tuxfan
tuxfan #23
Jul 21, 2005 at 12:08 PM
Nice tutorial Deep. I did it successfully because of it. Also, kalpik has put in valuable inputs for the improvement.

Thanks to both of you. :)
C
cheetah #24
Jul 21, 2005 at 6:56 PM
Man where was the tutorial hidden....It was posted on 1 March and i have seen it today 21,July 2005...

lolz i am a daily visitor to QNA section but havent seen it...the weird thing is that i have installed PHP,MYSQL,APACHE some 7 days back and i searched many websites for these steps....

Anyways Deep good work...
C
cheetah #25
Jul 21, 2005 at 7:14 PM
Guys i recommend phpMyAdmin for Mysql db management. Its just so easy to install. Just uncompress and some minor editing in config.inc.php file and it will save u from soo much hassle....
D
dineshhs #26
Dec 20, 2005 at 12:38 PM
Thanx guys.. I needed this very badly..