Complete WAMP Guide

Hi guys,

this is a guide to have a complete server installed on your pc. it will install the following and have them configured to work well together -

1) Apache Web Server - the worlds most popular server. More than all others put together. Open source and free.

2) PHP - popular scripting language and very versatile.

3) MySQL - excellent database server and very popular. Free without support.

WAMP​

This guide is meant to provide a person with little knowledge of handling web servers and allied software the ability to use such a powerful combination of web technology.

Apache
http://www.apache.org

Get the latest apache distro(win32 binary installer) from www.apache.org and install it on your machine.
It usually installs in c:\program files\apache group\apache2\
Select the custom install and select all the packages.
It is not necessary to change any of the other settings.
After install notice the apache monitor icon in the status bar and ensure that the status is green.
Open a browser window and type http://127.0.0.1 and check if the apache test page loads. This is the default index.html in your server and can be changed later.
Navigate to c:\program files\apache group\apache2\conf\ and open httpd.conf in a text editor.
Add these lines to the end of the file and save the file.


#php
ScriptAlias /php/ "c:/program files/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"


These lines tell apache that .php will be the extension which contains php code, where to look for files for processing .php files. If you have another extension for php then change .php in the 2nd line to that particular extension, say .phtml. If you like more extensions then separate them by commas.

PHP
http://www.php.net

Get the latest php version (windows binaries) and unzip it to a temporary directory, say c:\temp
Copy all the files in c:\temp\ to c:\program files\php\
Navigate to c:\program files\php\
Copy of php.ini-recommended to c:\windows\ and rename it to c:\windows\php.ini
Right Click on the apache icon in the status bar and then click “Open Apache Monitor”. Press the restart button and wait for the “Successfully restarted” message. Click OK.
Now we shall check that PHP is installed properly. Go to C:\Program Files\Apache Group\Apache2\htdocs and create a new file, say test.php and in it put these lines


<?
phpinfo();
?>


Open a new browser window and point it to the URL http://127.0.0.1/test.php
You should see a page which lists all the php settings and details. Now you have PHP installed and working!!!

Mysql
http://www.mysql.com

After the same old "get the latest version", begin the install. Install to default directory c:\mysql\ with the custom option and a full install. Then run “mysqld-max-nt.exe --install” from c:\mysql\bin\
Restart the computer now to get the mysql service started. Check if this is so by opening Task manager and confirm the running of mysqld-max-nt.exe.
Navigate to c:\mysql\bin and run winmysqladmin.exe. It will ask you to setup a user with a password. Do so. With this utility u can create databases for your programs and other basic stuff. Restart the computer one more time for the service to be initialised.
Now we can check this install with one more php file, say mysql.php with the following contents.
Don’t forget to replace <username> and <password> with the name, password you gave when u ran winmysqladmin.exe.


<?
$first = mysql_connect("localhost", "<username>", "<password>")
or die ("Could not connect");
print("Connected successfully");
mysql_close($first);
?>


This should present you with a “Connected successfully” message.

Congratulations!! Now you have successfully converted your pc into a full fledged server.
Place all the website files in

c:\program files\apache group\apache2\htdocs

and use http://127.0.0.1 to access them.
Don’t mind playing around with the configuration files as long as you are thinking logically and conscious of what you are doing.

Note:
You might like apache to serve index.php instead of index.html as default. To do this search in httpd.conf for the following line

DirectoryIndex index.html index.html.var

and change it to

DirectoryIndex index.php index.html index.html.var

Further information and guidance can be had from the excellent Apache, Mysql and PHP manuals on their homepages.

Have Fun!
 
Back
Top