Installing Apache 2.2.11, PHP 5.3 and MySQL 5.1.36 on Windows XP/Vista

August 31, 2009 at 1:46 pm Leave a comment

Installing Apache 2.2.11, PHP 5.3 and MySQL 5.1.36 on Windows XP/Vista

This tutorial shows you how to install and configure Apache 2.2.11 ,PHP 5.3 and MySQL 5.1.36 for Windows XP/Vista step by step .
The Tutorial is the modified version found at WebDevCodex. The screencast is also available.
Tools needed – All careware:
1. Apache HTTP Server (2.2.11)
Download Apache 2.2.11 (with no mod ssl) (169)
2. PHP 5.3 – Download PHP 5.3.0 (VC6 Thread safe)
3. MySQL 5.1.36

Before starting these downloads and install , be sure to turn off UAC (User Access Control) in Vista.
Downloads complete? Great. Now install Apache the PHP and then MySQL in that order.
Step 1 : Install Apache
1. First create a New Folder in C:\ and name it as server.
2. Launch the installation, agree to the terms in the license agreement .
3. In the Server Information dialog box, assign myserver.com,www.myserver.com and admin@myserver.com to Network Domain, Server Name and Admin’s email respectively.
4. Choose Custom Installation and specify the install path as C:\server\apache\
5. Once Installation is complete, verify your installation of Apache by opening http://localhost/ in your browser. It works? Great. We will configure Apache in the coming steps.
STEP 2 : Install & Configure PHP 5.3
1. Extract the PHP5.3 package
Open the zip file & Extract all your files to C:\server\php.
2. Navigate to C:\server\php
3. Rename php.ini- file
Search for the file, php.ini-development and rename it to php.ini
4. EDIT php.ini
Open up php.ini using Wordpad or Dreamweaver. There are 2 edits in this file
Edit 1
Find extension_dir = “./” and replace it with (Note the forward slashes)
extension_dir = “C:/server/php/ext”
Edit 2
Now in the following edit, you just have to uncomment (by removing the “; ”) from the extension to activate it. Semicolons are used to specify comments in the php.ini file.
Remove the semicolon in the following ;
;extension=php_gd2.dll
;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
Save the php.ini file and restart the apache server from Start->All Programs->Apache HTTP Server 2.2->Control Apache Server-> Restart
5. Adding PHP Environmental Variables in the System path
Navigate to Start->Control Panel->System->Advanced System Settings then go to the advanced tab, Click on the Environmental Variables button, then scroll down under system variables to find PATH, Edit it and add the following path, C:\server\php;
6. At this point you MUST reboot windows . REBOOT not Log Off. If you move on past that point without rebooting , apache won’t find MySQL extensions.

STEP 3 : Configure Apache 2.2.11
1. Now navigate to C:\server\Apache\conf\httpd
Edit httpd.conf
Open httpd.conf in Wordpad or Dreamweaver

Now roll up your sleeves!
Edit 1
Search for
#LoadModule rewrite_module modules/mod_rewrite.so and uncomment it.
That is, replace with
LoadModule rewrite_module modules/mod_rewrite.so
Edit 2
Add the following below the previous edit
#PHP5
LoadModule php5_module “C:/server/php/php5apache2_2.dll”
PHPIniDir “C:/server/php”
Edit 3
Search for
AddType application/x-gzip .gz .tgz
Add the following below the searched line
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Edit 4
Search for
DirectoryIndex index.html
Replace with
DirectoryInde
x index.html index.htm index.php index.phps
Edit 5
Search for
SciptAlias /php/ and replace with
ScriptAlias /php/ “C:/server/php/”
Edit 6
Search for
#Include conf/extra/httpd-vhosts.conf
Replace with
Include conf/extra/httpd-vhosts.conf
2. Now navigate to C:\server\Apache\conf\extra
Edit httpd-vhosts.conf
3. Replace all the text inside with

DocumentRoot “C:/Server/www/myserver.com/public_html”
ServerName myserver.com
ServerAlias http://www.myserver.com

AllowOverride All
Options Indexes FollowSymLinks
Order allow,deny
Allow from all

4. Restart the Apache Web server

Step 4 : Testing our Apache + PHP
1. Create Directories to store your web files

1. Inside the C:\server folder, create folder called www
2. inside C:\server\www\ create myserver.com
3. and then finally create public_html folder inside your C:\server\www\myserver.com\
Follow this structure C:\server\www\myserver.com\public_html\
This is where you will be putting all your html and php scripts to be accessed by your webserver.
2. Create index.php
Open up notepad, type in the following code and save the file as index.php inside C\:server\www\myserver.com\public_html\

Please specify the ALL Files type while saving the file as index.php
Launch a browser and enter in the URL, localhost/index.php
STEP 5 : Configuring MySQL5.1.36
1. Launch the MySQL installer.
2. Select the Typical set up type, click Next
3. Click Next after reviewing where you are installing
4. Skip the Sign-up.
5. On complete of MySQL,launch the MySQL Server Instance Config Wizard (from Start->All Programs->MySQL)
6. Just follow through with the defaults
Be sure to check the Include Bin Directory in Windows PATH
Specify Username as root and password as root . Root is the default user and his default password is root.
Then click Execute
7. Test MySQL along with Apache+PHP
Restart the webserver and launch http://localhost/index.php again
To verify whether MySQL5 has been installed, scroll down the page until you come across mysql & mysqli heading
mysql and mysqli are extensions for MySQL
8. There you go. You have Apache2.2.11, PHP5 and MySQL5 installed on your system.

Having any troubles, post them here. Godspeed!
Bamidele Muyiwa.

About these ads

Entry filed under: Uncategorized. Tags: , , , .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

August 2009
M T W T F S S
     
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Most Recent Posts


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: