Installing Apache2.2, MySQL5.2 & phpMyAdmin2.7

All Other Tutorials

Tutorial

Click on thumbnailed images to enlarge

# INTRODUCTION
This is perhaps the simplest installation and configuration instructions ever made for non-professionals and enthusiasts (like me!). All instructions are fully simplified and rewritten based on the already published detailed instructions on the Internet (which are blindly for experienced programmers only). It took me months to figure out and after compiling all the available tutorials I've decided to write these guidelines for everyone else and of course for my own personal reference as well :)

# ABOVE ALL
If you wish to install Apache without doing things manually, safely download softwares available out there that helps you set up everything. This software usually includes everything in it (Apache, PHP, MySQL and phpMyAdmin) and you only need to set where you want to install the software.

But if you wish to do it manually, you can try these steps as a dummy start :)

This tutorial is for the following specs

1. Windows XP
2. PHP version 5.2
3. MySQL version 5.0
4. Any phpMyAdmin version, preferably 2.7

# IMPORTANT TO NOTE THAT...
Guidelines here are NOT written by professional(s). These are redefined instructions using inaccurate terms. The nearest (perhaps dumbest) thoughts are used to interpret all technical terms. Using this guideline is at your own risk. However be reminded of a few things before you start installing anything. I will foolishly assume that...

1. You know how to do all basic operations of a computer, e.g: copying, renaming, moving, installing, create directories, etc although not one or more of the said knowledge are necessarily used later on.
2. Comfortable with the Internet browser. You'll see why as you get along.
3. If you are using other than XP, type in the following in your URL box to find tutorials for Older versions of Windows

- http://google.com/search?q=how+to+install+apache

# AND PLEASE...
1. Use a better textpad other than NotePad. I'm using EditPad Pro. When you open certain configuration files, line breaks are nicely realigned. If you use NotePad you'll get a bigtime headache and constant cursings will occur.

# WHY DO WE NEED TO INSTALL APACHE?
Firstly like my own reason in the first place was (and still is) to learn how to write PHP. In order to run PHP files like any other HTML documents, a webserver is required to process these files. So the solution is to install a webserver (APACHE for example) locally (on your computer) thus running an Intranet server.

I hope these guidelines are easy to follow, but if you find trouble understanding them, please feel free to refer to me (although I'm not an expert myself but I can try). Or else try searching for more detailed instructions by typing in the one of the following in your URL box

- http://google.com/search?q=how+to+install+apache
- http://google.com/search?q=how+to+install+a+webserver
- http://google.com/search?q=install+apache

Good Luck.

# DOWNLOAD REQUIRED FILES
1. apache_2.0.55-win32-x86-no_ssl.msi (apache.org)
2. mysql-5.0.18-win32.zip (mysql.com)
3. php-5.1.2-Win32.zip (php.net)
4. php-5.1.2-installer.exe (php.net)
5. phpMyAdmin-2.7.0-pl2.zip (phpmyadmin.com)

# BEFORE INSTALLATION AND CONFIGURATION OCCUR...

1. To configure these applications, first you need to decide a single directory for a more organized installation, although by default the configuration file for PHP (php.ini) & MySQL5 module for PHP5 (libmysql.dll) will be installed in C:/WINDOWS

2. The configurations are, in layman's term; intended to point to the installation directories so that required files and settings can be fetched whenever you start these applications.

3. From my own configuration, I use E:/ instead of the normal C:/ (by default) so my active webserver is pointing to E:/ and can be reached as http://localhost

# CONFIGURE APACHE
1. Follow the on-screen instructions, install like any normal programs.

2. Whatever inquiries regarding domain name or server name, use "localhost" (meaning your computer) so that by default your computer's domain when you launch you Intranet will be "http://localhost". Imagine localhost as "adomain.com" or something like that. Logically your email address is you@localhost.

3. Find the first word(s) of the following and add the following setting(s)

- DocumentRoot
: by default it is "D:/Web server"
: change to where you want to set your active domain, if you install everything in C:/ then type

DocumentRoot "C:/"

: so that means, your entire C:/ drive is an Intranet access

- <Directory "D:/Web server">
: if you notice the guideline included in the configuration file, it is recommended to change this to the same as DocumentRoot

- ServerName
: by default it is empty
: change to

localhost

- DiretoryIndex
: by default you will have DirectoryIndex index.html.var
: change to...

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

: meaning, the first file to look for is index.html, so if you type http://localhost it is actually pointing to http://localhost/index.html

: if index.html is missing, index.php will be looked for

: set your priority for which file to lookup first, normally we use index.html

4. Finally, add the following at the last line of your httpd.conf file, just cut and paste

LoadModule php5_module "C:/php5/php5apache2.dll"
AddType application/x-httpd-php .php

5. Change the directory setting of your php5_module to a file called php5apache2.dll
: by default, in PHP5, the directory for this module is in C:/php5/php5apache2.dll but just to make sure, try finding the file :)

# CONFIGURE MySQL5
1. Unzip and execute the "Setup.exe" file. Install like a normal program. By default, I assume you install it in C:/MySQL5

2. Any further configurations during installation shouldn't be changed, but if you feel you should there's no harm trying though.

# CONFIGURE PHP5
1. Unzip php-5.1.2-Win32.zip to a directory. If you installed MySQL5 as C:/MySQL5 then appropriately unzip PHP5 as C:/PHP5

2. Unzip php-5.1.2-installer.exe and run the installer. Install in C:/PHP5 directory (same as php-5.1.2-Win32.zip unzip directory)

3. No changes required, everything is set when we installed Apache earlier

4. Except, copying the files php.ini and libmysql.dll in your PHP5 installation directory to C:/WINDOWS

: php.ini is the configuration file for PHP

: libmysql.dll is the required module to run MySQL using PHP5. In older versions of PHP, the modules are automatically included

: In one of the posts in php.net forum, somebody mentioned that PHP5 is not including MySQL5 by default. Don't ask me why because I don't know either, but if you're curious, go to php.net forum and search for "libmysql.dll" or "PHP5 module". The solution I found in the forums was to copy "libmysql.dll" to C:/WINDOWS. It was mentioned there are some complications might occur although so far running MySQL has brought no problem to me at all, perhaps what was metioned was about a more technical side of the problems which are not so visible or not giving much impact. If the intention to install Apache is to learn PHP and basic MySQL operations only then you shouldn't be facing any/much problems.

: In the long run, you will want to activate extra modules or change your settings depending on what you are doing, for example allowing multiple user on MySQL as the administrator, etc etc then try referfing to a more technical guideline on the Internet. There are plenty of them.

# CONFIGURE phpMyAdmin

1. Unzip to a directory like you did for PHP5 files. C:/phpMyAdmin

2. Find config.default.php and copy as config.inc.php

3. Change the following variables

$cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin/'; // path for phpMyAdmin
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['extension'] = 'mysqli'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'your_password'; // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // Database used for Relation, Bookmark and PDF Features

# YOU'RE DONE :)
That's it! These are the most basic setup for all the required files to run PHP on your computer. Actually by just installing Apache and PHP only you already can run PHP files but usually you should be installing MySQL as well because that was the core reason for using PHP in the first place. To create databases.

phpMyAdmin is important especially for IT-lamers like me. You can easily set up database because phpMyAdmin is web-based application, otherwise you have to use a more complex method to create databases using MySQL command line.

If you feel something is lacking, again, refer to more technical guideline or mail me at me@bottie.org

Tutorial Comments

Showing latest 1 of 1 comments

Very helpful, thank you very much!

By taddred on Dec 22, 2009 3:56 am

Tutorial Details

Author birdman View profile
Submitted on May 2, 2006
Page views 21,407
Favorites 1
Comments 1