#native_company# #native_desc#
#native_cta#

Installing Apache and PHP under Win32

By Dennis Wrenn
on June 8, 2007

If you are on this site, we’re sure that you already know that PHP is a server side web programming language. Its purpose is very similar to ASP, but in my opinion, it’s better.
There are more databases available to use with it and ASP can only communicate with
Access and SQL servers. PHP can communicate with SQL Server, MySQL, mSQL, and
several others, but that is not the topic of this tutorial.
What’s Apache?
Apache is a web server, similar to
PWS, and IIS. They, and it, listen(s) on a specific port (usually it’s 80) and allow you to
run a website off of your home computer. Neat, Eh?

Installing Apache

First you need to download Apache Do that here.
It’s fairly large (about 3.6mb), so be patient. After downloading, double click
the exe. Installing is a breeze, but configuring isn’t that easy.

Configuring Apache
Move to your apache directory after installing. It’s usually
C:Program FilesApache GroupApache. Look for, and open, a folder called conf.
Open the file called httpd.conf. It may look cryptic and confusing at first, but
about half the file is made up of comments, which begin with a “#” mark.

The parts in red need to be found, and the parts in
green need to be changed or added. (NOTE: I removed all
the file comments for the sake of size – those comments shown below are there just as a guide for you.)

DocumentRoot "C:/website"

#NOTE: you can change c:/website 
#to anything you want, that is just 
#happens to be where I store my files. 
#Another NOTE: All slashes must be forward /
<Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride None
</Directory>

<Directory "C:/website">
    Order allow,deny
    Allow from all
</Directory>

After changing that, place a file (we’ll call ours filename.htm) to the document root you set. Then start
Apache (by clicking Start button -> Program Files -> Apache ->
Management -> Start Apache). Now use your favorite browser, and type in:

http://localhost/filename.htm

You should get your file. Cool. If so, keep reading. If not, then email me and tell me what the problem is. Be sure to send the complete httpd.conf file.
Installing PHP
This part is fairly easy, the PHP homepage is php.net, you can download the PHP 5.2.3 installer here. This file is quite big too. So, again, be patient. Now, unzip the file
to C:php.