Installing Apache,PHP 5, and MySQL 5 for Windows

Installing Apache 2.2.4, PHP 5.2.4, and MySQL 5.0.45

Or easy Steps to have WAMP in your windows server. (Tested on Windows XP)

1.      Installing Apache
2.      Install PHP5
3.     Configure PHP5 to Work with Apache
4.      MYSQL
5.      Configure PHP to work with MySQL
6.      XML-RPC Extension

 

 

Installing Apache

 

In your browser, go to http://httpd.apache.org/download.cgi

 

 Click on the Win32 Binary (MSI Installer) link.

 

Make sure IIS is disabled


Read This:
Before we install Apache, we need to make sure the Windows Internet Information Server (IIS) is disabled (if it is installed and running). The reason is that IIS and Apache are both web servers and they will conflict if they are both running at the same time.

 

 Otherwise to make sure IIS is not running, do the following: Start | Settings | Control Panel | Administrative Tools | Services. Then click on column label "Name" to list the services in reverse alphabetical order. If IIS is running then you will see an entry named "World Wide Web Publishing" at the top. Click on that and then click the stop button. After a couple seconds your screen will look like the screenshot here. This means that your IIS has been stopped and you may continue to the next step "Install Apache".

 

Install Apache

 

To see if the installed Apache server actually works, open your browser and type http://localhost. If you see this site, Apache is successfully working on your computer.

 

 

Install PHP5

 

Download PHP5

 In your browser, go to www.php.net/downloads.php.

 

 Click on the PHP 5.2.4 zip package link. Be sure NOT to download the Windows installer since this doesn't include important packages such as XSLT support.

 

Unzip all php files, copy all files to the c:\php directory, (create it, if it doesn’t exist)

 

 Now move (don't just copy) the file c:\php\php5ts.dll to c:\windows\php5ts.dll (or if you don't have a c:\windows directory, move it to c:\winnt).

 

 

Configure PHP5 to Work with Apache

 

 

Rename the c:\php\php.ini-dist to c:\php\php.ini, then make the following changes in the c:\php\php.ini file: (1) doc_root = "c:\www" and (2) extension_dir = "C:\php\ext\"

 

 In the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the DocumentRoot entry to: DocumentRoot "C:/webs/test". Note that you should use FORWARD SLASHES in the http.conf file.

 

Also in the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the Directory entry to: .Note that you should use FORWARD SLASHES in the http.conf file.

 

Again in the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file, add the following lines: hint: to find this position fast, search for "media types"

You can copy this text:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php "/php/php-cgi.exe"
SetEnv PHPRC "C:/php"

Lastly, we need to make one last change to this C:\Program Files\Apache Group\Apache2\conf\httpd.conf file. Find the "DirectoryIndex" entry and add "index.php" to the end of the line as shown.


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

To Fix the ‘Forbidden Error’:
Change in httpd.conf

 


  Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Satisfy all

For


    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
    Satisfy all

In order for the changes to take effect, you need to restart Apache. To do this, click the Apache symbol in the lower right-hand corner of your task bar. In the little menu that pops up there, click Apache 2 and then Restart.

 

MYSQL

 

In your browser, go to http://dev.mysql.com/downloads. And choose Windows ZIP/Setup.EXE (x86) the latest version for the windows platform

ONCE INSTALLED:

To change the root password:

In the mysql command line  type:

Mysql> use mysql;

UPDATE user

    -> SET password = PASSWORD('mypassword')
    -> WHERE user = 'root';
 

To change Database DIR, locate the file my.ini and edit these lines to your own convenience

#Path to the database root
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"

 

Configure PHP to work with MySQL

1. enable the MySQL extension in php.ini by uncommenting the line extension=php_mysql.dll

2. copy libmysql.dll to the system32 directory (php_mysql.dll would not load without doing this)

3. set the extension_dir in php.ini to the ext directory of your PHP installation directory (like e.g. extension_dir=C:\php5\ext)

4. Restart Apache Server

 

XML-RPC Extension

Is the XML - Remote Prcedure Calling extension, if you need it in php.ini uncomment:

extension=php_xmlrpc.dll

Do likewise for any other extension you want.

 

Happy coding!