Step 1 : Downloading required files.
apache server binaries : httpd.apache.org
php binaries : www.php.net
Step 2 : Install apache server.
Installing apache server is pretty much simple, and same as any other installation.
Just enter a network domain name and server name and some email id (email@example.com).
Then choose a installation directory : for reference i am using "C:\".
Note that a directory called apache2 will be created under C:\ .
So "C:\apache2\" is our directory.
Verify your installation by taking your browser and visiting http://127.0.0.1 or http://localhost.
You will see a page that confirms your apache installation.
Step 3 : Configuring apache
Now goto "C:\Apache2\conf\".
Open the file "httpd.conf" in any text editor.
Lines beginning with # are comments .. just read them to know how to tweak apache.
Change the DocumentRoot property to the folder which is the root of the site.
# 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.
and after that a few lines under ..
# This should be changed to whatever you set DocumentRoot to.
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
# The Options directive is both complicated and important. Please see
# for more information.
Options Indexes FollowSymLinks
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
# Controls who can get stuff from this server.
Allow from all
So C:\public_html\ is the server root. ie http://localhost/ = C:\public_html.
After this is done test the configuration by executing (command line):
If the syntax is right you will get a "Syntax OK" message.
Step 4 : Installing php
To install php, just extract or copy the "PHP" folder to C:\Apache2\ so that C:\Apache2\PHP is created.
Step 5 : configuring PHP
Copy the "php.ini-recommended" file from C:\apache2\php\ to C:\apache2\
Rename it to "php.ini".
Add 2 lines to the end of the file httpd.conf:
LoadModule php5_module C:/apache2/php/php5apache2.dll
AddType application/x-httpd-php .php
Test the php installation by making a php file.
Access the test.php (http://localhost/test.php) from your browser. If you see the source code, installation has failed.
If you see the php info file . PHP installation was successful.
Test the apache server configuration (mentioned above) to find out the error.
Stuck ? leave a comment...