<h1>Manually installing the PHP package</h1>
<h2>Downloading PHP for Windows</h2>
You can find the binary of PHP at <em>http://www.php.net/downloads.php</em>
[<a href="http://www.php.net/do_download.php?download_file=php-4.2.1-Win32.zip">direct link</a>]. The file is 5.2 MB, and is distributed as a single zipped file.
<h2>Installing PHP</h2>
Extract the zip file to a directory of your choice. I put mine at <em>H:php</em>.
Some servers might crash if there's a space in the path name (i.e. <em>H:My
3l33t PHP Installation</em>), so try to steer clear of that.
<h3>Copying required files</h3>
You'll need to copy the file <em>php4ts.dll</em> to your <em>C:WINNTsystem32</em>
folder (or <em>C:Windowssystem32</em> for Windows XP). Also copy the file
<em>php.ini-recommended</em> to your <em>C:WINNT</em> folder (or <em>C:Windows</em>
for XP) and rename it to just plain ol' <em>php.ini</em>.
<h3>And now for more file copying</h3>
Due to some changes in the working of Apache 2.0.39, the standard PHP DLL file
for Apache2 will no longer function "out-of-box." This can be solved
easily, by downloading <em>http://www.ubbdev.com/files/php4apache2.dll</em>
[<a href="http://www.ubbdev.com/files/php4apache2.dll">direct link</a>]. Save
and copy that file to your <em>H:phpsapi</em> directory, overwriting any
existing file. Life is good--for the moment, at least.
<h2>Editing your php.ini</h2>
Open up your newly copied and renamed <em>php.ini</em> file. Search for <code>extension_dir
=</code> and change it to read <code>extension_dir = H:phpextensions</code>
(making sure to modify it to reflect <em>your</em> actual path). Search for
<code>doc_root =</code> and change it to <code>doc_root = H:httpdocs</code>
where the path is the same as the one you picked for your HTML files back
in step one. Sounds easy enough, right?
We'll leave the rest of the file alone for now, but if you'd like to modify
more on your own, read up at <em>http://www.php.net/manual/en/configuration.php</em>.
<h2>Apache, meet PHP</h2>
We're going to run PHP as a module for Apache, instead of as a CGI binary,
because it's more transparent and secure. And you really care about that,
right? You're just waiting for me to get to the good stuff, so here we go.
Open up your <em>httpd.conf</em> file again (it's the last time, I promise)
and search for <code>#LoadModule ssl_module modules/mod_ssl.so</code>. Directly
underneath that line, add <code>LoadModule php4_module H:/php/sapi/php4apache2.dll</code>.
To try to keep all the "scripting stuff" in the same spot of my <em>httpd.conf</em>
file, I put the remaining lines necessary for PHP near the line we modified
in order to use Perl before. Search for <code>AddHandler cgi-script .cgi .pl</code>
and then add this block of code a line or two below that.
#
# To use PHP scripts:
#
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
The final section around that block should look like mine, which is below.
#
AddHandler cgi-script .cgi .pl
#
# To use PHP scripts:
#
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
#
# For files that include their own HTTP headers:
<h3>Restarting the server</h3>
After making the outlined changes to <em>httpd.conf</em>, save and close the
file. Then, double-click the <kbd>Apache Service Monitor</kbd> icon in the
tray to pop open--you guessed it--the Apache Service Monitor! Click the <kbd>Restart</kbd>
button and then wait a few seconds while Apache shuts down and starts back
up.
When the server comes back online, your screen should look like mine; also
take note of the text at the bottom of the window that reads <kbd>Apache/2.0.39
(Win32) PHP/4.2.2-dev</kbd>. This just means that all is well in Apache land.

<h2>Your first PHP script</h2>
Copy 'n paste
[/code]into a new file in <kbd>Notepad</kbd> and then save it as<em> H:httpdocsphpinfo.php</em>. To recap, the entire file should read [code]
Now browse to <em>http://127.0.0.1/phpinfo.php</em> and check to make sure
that what you see looks like my screen shot below.

If you can't see this screen, you hit a bump in the road somewhere along the
way. Your first move should be to visit <em>http://www.php.net/manual/en/install.apache.php</em>.
Start by reading the newest comments (the ones at the very bottom of the page)
to check if your problem has already been encountered by another user.
<h2>Enabling compressed output</h2>
Optionally, you can choose to compress PHP output using
zlib compression.
This cuts down on your bandwidth and also helps pages to load faster. If you'd
like to turn zlib on, just follow the steps below.
According to the zlib Web site (
http://www.gzip.org/zlib/), zlib is "a
free, general-purpose, legally unencumbered--that is, not covered by any patents--lossless
data-compression library for use on virtually any computer hardware and operating
system." So there you have it, straight from the horse's mouth. Let's
turn it on already, shall we?
In <em>php.ini</em>, search for <code>zlib.output_compression = off</code>
and change it to read <code>zlib.output_compression = on</code>. All you have
to do next is search for <code>;extension=php_zlib.dll</code> and change the
line to read <code>extension=php_zlib.dll</code>. Browse to <em>http://127.0.0.1/phpinfo.php</em>
once more and then scroll down to the section about zlib. You should see what
I see.
Page 4:
Installing MySQL as a service