Installing Apache & PHP
-----------------------
First of all, download the PHP Windows Installer and the Apache Webserver from this
locations:
PHP 4.3.8: [
url]http://www.php.net/get/php-4.3.8-installer.exe/from/a/mirror[/
url]
Apache : [
url]http://mirrorspace.org/apache/httpd/binaries/
win32/apache_2.0.51-
win32-x86-no_ssl.msi[/
url]
Then install the Apache Webserver by following the setup instructions (use "
localhost"
as servername). In conclusion you must install PHP. Therefor follow the setup instructions
again (it will show a message that it was unable to configure Apache, but it's ok
because this feature isn't inmplementet jet in the installer).
Now you have to configure the webserver to get it working properly (first you may check
whether it's installed corectly or not. To do so, open your browser and navigate to
[
url]http://
localhost/[/
url] or [
url]http://127.0.0.1/[/
url] A "Apache is running" screen should appear!):
Open the apache httpd.conf file. You find it in the Apache startmenu entry > Configure
Apache Server > Edit the Apache http.conf configuration file! Use the search function of
your editor to find "DocumentRoot". You'll find this:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/"
Set this variable's value to the directory path you want to use as a server, e.g. like this:
DocumentRoot "C:/MyServer"
Attention: slashes have to be / and NOT \ like usual in windows!
You have to create this directory manually! Repeat the search and you'll find this:
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/">
Like explained in the comment, type the same directory as before here again!
Finally add this code to the end of the configuration file:
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
Action application/x-httpd-php "/php/php.exe"
You only have to customize the folder in the first line to where you have installed PHP!
Now files called .php, .php3, .php4 and .phtml are parsed through the PHP interpreter.
For further information on configurating Apache read the fine comments inside the
configuration file!
For testing your PHP scripts you have to put them into your DocumentRoot directory and
open them in your browser with [
url]http://
localhost/file.php[/
url] , where
localhost substitudes
the same as your DocumentRoot directory but only with this method the scripts get executed!
Simply ask me if you have problems! Have Fun,
Meflin