This guide is meant to help those who want to start creating web applications or dynamic web pages with php and mysql on an apache web server but don’t know how to start. Hope it helps 
The guide will follow these steps:
1. Installing and setting up Mysql
2. Installing and setting up Apache
3. Installing Php
4. Configuring Php
5. Testing the installation
6. Installing and setting up phpMyAdmin
MySql
Download the MySql essentials installer from the mysql website here.
Start the installation and proceed along typical installation (unless you know what you are doing). During the installation you will be prompted to sign up for a mysql account. Doing so will let you post at their forums and some other benefits.
As the installation finishes, the MySql configuration wizard will appear.
There are two types of configurations, standard and detailed. Standard configuration is good enough for starters, but if you are sure of your use of the database, you might go for detailed. One thing you can do in detailed is that you can specify the port to use for the database, so that you might free it up incase you are using a firewall.
During this step, the security configuration is very important. Do not allow root access from remote machines or create an anonymous account as that creates security vulnerabilities.
The wizard will now finalize the configuration settings, write the necessary scripts and start the database engine. In case you are using a firewall and the database tries to use a blocked tcp port, you will be prompted to unblock it in this step. Do that.
Apache
Download the apache web server installer from here
Though Apache2 has some improvements over Apache for win32, but it has issues with php. So it is suggested that you download Apache 1.x (latest is 1.3.37). it is a simple executable file. Download it and run the installer.
After a few clicks, the installer will ask for the server information. If you are installing it in a remote machine, give localhost in the first two blanks, and any email.
Choose to run it as a service for all users.
In the next step, choose custom if you don’t want to install the documentation. Else proceed to complete the installation.
Php
Download the latest version of php from the php website here
Though there is a windows installer available, it is better to download the windows zip package and configure php manually.
Unzip the files to anywhere you want and rename the directory to something short (mine is C:\php)
Take care that the path to the php directory does not have any spaces. That is known to crash the server.
Configuring php
Add the php folder to windows path by Start->Control Panel->System->Advanced->Environment variables. There scroll down the system variables list, double click on PATH and append the directory at the end.
For Apache
Copy the php5ts.dll file in the php folder to the bin directory under Apache’s installation directory.
Copy the file php.ini-dist to the Window's directory and rename it php.ini
(The php.ini file controls how PHP behaves. The Zip package comes with a couple of examples of this file, php.ini-dist being one of them.)
From the Start menu, select Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File.
1. At the end of the LoadModule section, add
Use the path to your php directory instead of C;/php in here.
2. At the end of the AddModule section add
3. Find where it says <IfModule mod_mime.c> and add
4. Find the line that begins with DirectoryIndex and change it to read
This lets index.php be a main file in a directory
Close and restart Apache by running the commands
One after the other.
For MySql
Open the php.ini file that was earlier placed in the WINDOWS directory and open it in notepad.
Scroll down the file and find the line beginning with extension_dir. remove whatever is there between the quotes and add the following line in there
Provided your php installation is in C:\php. Else use what is applicable.
Next scroll further down till you reach the section for Dynamic Extensions there you will find that a number of extension dlls are listed, and a ‘;’ is present at the start of each line. Find the lines saying
and remove the semicolon.
While you are here, you can also enable the extension for php_mbstring, as it would be needed later for setting up phpMyAdmin.
Testing the installation
Apache
Open notepad and put in the following code
Save the file as phpinfo.php under htdocs directory under the Apache installation directory.
Open up your web browser and give the following address in the address bar
If Apache and php has been properly connected, went well, a page listing all the information about your php installation would be displayed.
MySql
Create another php file with the following code
place ‘root’ as username and you MySql server password as password and save the file as mysqltest.php under htdocs.
Run the script in your browser. If connection is working, the browser window will display something like
Congratulations!!! You have successfully setup the Apache web sever and MySql database server in your machine for php:hap2:
Installing and Configuring phpMyAdmin
phpMyAdmin is a popular, powerful web-based interface for administering MySQL databases, written in PHP and published under the GNU General Public License. It works as a nice replacement of the command line and is very convenient to use when you are developing applications with php and MySql using the Apache web server.
Install steps
Download the zipped folder of phpMyAdmin from here and unzip it to /Apache/htdocs. Rename it something short (phpmyadmin in my pc)
Open a browser and enter http://localhost/phpmyadmin/index.php in its address bar.
The phpMyAdmin welcome page should be displayed, but with some error, like the following
Create a file config.inc.php under the directory C:\Program Files\ApacheGroup\Apache2\htdocs\phpmyadmin\ and put in the following code
For blowfish parser, you can use any string within 46 characters..
Save and close the file
In the php.ini file, if you haven’t already uncommented the extension php_mbstring.dll, do it now.
Close and restart Apache.
Reload the phpmyadmin script in your browser. The login page should be displayed now.
Enjoy.........:clap: :clap: :clap:
----------------------------------------------------------------------------
Resources:
php manual
mysql docs
apache docs

The guide will follow these steps:
1. Installing and setting up Mysql
2. Installing and setting up Apache
3. Installing Php
4. Configuring Php
5. Testing the installation
6. Installing and setting up phpMyAdmin
MySql
Download the MySql essentials installer from the mysql website here.
Start the installation and proceed along typical installation (unless you know what you are doing). During the installation you will be prompted to sign up for a mysql account. Doing so will let you post at their forums and some other benefits.
As the installation finishes, the MySql configuration wizard will appear.
There are two types of configurations, standard and detailed. Standard configuration is good enough for starters, but if you are sure of your use of the database, you might go for detailed. One thing you can do in detailed is that you can specify the port to use for the database, so that you might free it up incase you are using a firewall.
During this step, the security configuration is very important. Do not allow root access from remote machines or create an anonymous account as that creates security vulnerabilities.
The wizard will now finalize the configuration settings, write the necessary scripts and start the database engine. In case you are using a firewall and the database tries to use a blocked tcp port, you will be prompted to unblock it in this step. Do that.
Apache
Download the apache web server installer from here
Though Apache2 has some improvements over Apache for win32, but it has issues with php. So it is suggested that you download Apache 1.x (latest is 1.3.37). it is a simple executable file. Download it and run the installer.
After a few clicks, the installer will ask for the server information. If you are installing it in a remote machine, give localhost in the first two blanks, and any email.
Choose to run it as a service for all users.
In the next step, choose custom if you don’t want to install the documentation. Else proceed to complete the installation.
Php
Download the latest version of php from the php website here
Though there is a windows installer available, it is better to download the windows zip package and configure php manually.
Unzip the files to anywhere you want and rename the directory to something short (mine is C:\php)
Take care that the path to the php directory does not have any spaces. That is known to crash the server.
Configuring php
Add the php folder to windows path by Start->Control Panel->System->Advanced->Environment variables. There scroll down the system variables list, double click on PATH and append the directory at the end.
For Apache
Copy the php5ts.dll file in the php folder to the bin directory under Apache’s installation directory.
Copy the file php.ini-dist to the Window's directory and rename it php.ini
(The php.ini file controls how PHP behaves. The Zip package comes with a couple of examples of this file, php.ini-dist being one of them.)
From the Start menu, select Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File.
1. At the end of the LoadModule section, add
Code:
LoadModule php5_module "C:/php/php5apache.dll"
Use the path to your php directory instead of C;/php in here.
2. At the end of the AddModule section add
Code:
AddModule mod_php5.c
3. Find where it says <IfModule mod_mime.c> and add
Code:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
4. Find the line that begins with DirectoryIndex and change it to read
Code:
DirectoryIndex index.html index.php
This lets index.php be a main file in a directory
Close and restart Apache by running the commands
Code:
NET STOP APACHE
NET START APACHE
For MySql
Open the php.ini file that was earlier placed in the WINDOWS directory and open it in notepad.
Scroll down the file and find the line beginning with extension_dir. remove whatever is there between the quotes and add the following line in there
Code:
C:\php\ext
Next scroll further down till you reach the section for Dynamic Extensions there you will find that a number of extension dlls are listed, and a ‘;’ is present at the start of each line. Find the lines saying
Code:
;extension=php_mysql.dll
;extension=php_mysqli.dll
While you are here, you can also enable the extension for php_mbstring, as it would be needed later for setting up phpMyAdmin.
Testing the installation
Apache
Open notepad and put in the following code
Code:
<?php
phpinfo();
?>
Open up your web browser and give the following address in the address bar
Code:
[url]http://localhost/phpinfo.php[/url]
If Apache and php has been properly connected, went well, a page listing all the information about your php installation would be displayed.
MySql
Create another php file with the following code
Code:
<?php
echo mysql_connect ('localhost', 'username', 'password');
?>
Run the script in your browser. If connection is working, the browser window will display something like
Code:
Resource id #2
Congratulations!!! You have successfully setup the Apache web sever and MySql database server in your machine for php:hap2:
Installing and Configuring phpMyAdmin
phpMyAdmin is a popular, powerful web-based interface for administering MySQL databases, written in PHP and published under the GNU General Public License. It works as a nice replacement of the command line and is very convenient to use when you are developing applications with php and MySql using the Apache web server.
Install steps
Download the zipped folder of phpMyAdmin from here and unzip it to /Apache/htdocs. Rename it something short (phpmyadmin in my pc)
Open a browser and enter http://localhost/phpmyadmin/index.php in its address bar.
The phpMyAdmin welcome page should be displayed, but with some error, like the following
Create a file config.inc.php under the directory C:\Program Files\ApacheGroup\Apache2\htdocs\phpmyadmin\ and put in the following code
Code:
<?php
$cfg['PmaAbsoluteUri'] ='http://localhost/phpmyadmin/';
$cfg[blowfish_secret] = 'funkymonkey';
$i = 1;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['extension'] = 'mysqli';
?>

Save and close the file
In the php.ini file, if you haven’t already uncommented the extension php_mbstring.dll, do it now.
Close and restart Apache.
Reload the phpmyadmin script in your browser. The login page should be displayed now.
Enjoy.........:clap: :clap: :clap:
----------------------------------------------------------------------------
Resources:
php manual
mysql docs
apache docs