Setting up Apache, PHP and MySQL manually

From Joomla! Documentation

Revision as of 12:53, 26 May 2010 by Gobezu (Talk | contribs)



Here follows a brief overview of the steps to setup a Apache, PHP, MySQL in a Windows environment and also refer to various related tools to maintain and work with most of the tasks related to Joomla!.

In order to make the instruction clear and succinct, we will assume that wherever we are not stating any explicit instruction, you will let the default setup paths apply without modification.

MySQL setup

  1. Download the appropriate MySQL installer option for your platform (commonly x86, 32-bit) from
  2. Start the installation and choose Custom installation path
  3. Click through the whole installation process and click Finish
  4. You will now be presented with the "MySQL Server Instance Configuration Wizard"
    1. Make sure that the "Standard Configuration" is selected and go to Next
    2. In the next window Check for "Include Bind Directory in Windows PATH". By doing this you will be able to access the various MySQL utilities from the command line.
    3. In the next window you will be able to create password for your root MySQL user, the user with highest access level on your server.
    4. In the next and final window all the changes you have configured until now will be saved when you press the Execute button, and the windows service for this instance will be started.


  1. In order to make the instruction as accessible as possible we skipped a number of configuration scenarios of your MySQL instance, such as being able to relocate your database files etc. This and more is outlined in
  2. MySQL installs as default with a STRICT mode which might give rise to some errors when using extensions or applications that haven't considered this. Refer to this resource for more on this:

Resources and tools to work with your MySQL instance

Apache setup

  1. Download the installer of your preference. Currently you should aim for version 2.2.*, Win32 Binary without crypto applies) from
  2. Run the installer wizard until and in the Server Information window give the options below respectively and in the given order in each of the fields, unless you have any specific requirments as to how you http server is installed.
    1. localhost,
    2. localhost and
    3. admin@localhost
  3. Click through the whole wizard which will install and start the apache web server as a windows service.
  4. In the windows status bar you will now see a pink colored feather with a green colored play button indicating Apache is up and running. Point your browser to http://localhost/ and you should get a page indicating its working.
  5. Let us now go to the location where Apache is installed which commonly is at C:\Program Files\Apache Software Foundation\Apache2.2 and go through the various directories
    1. bin - contains the various binary files some of which are listed below. In order to access this applications, most of which are command based, we would need to add the path to the bin directory in our global PATH variable. To do that right click on My Computer > Properties > Advanced > Environments Variables and in the System Variables list locate and select the Variable PATH and click on Edit and add trailing a semi-colon followed by the absolute path to your bin directory. And click out from the System Properties dialogue by accepting all the way.
      1. httpd.exe which is the Apache webserver itself, which is spawned to several child processes while running serving as many simultaneous incoming requests as required;
      2. ab.exe is the benchmarking tool that comes with Apache
    2. conf - folder where various configuration files are located of which the following are of most interest in our case
      1. httpd.conf - most of the server directives are located in this file and for easy access you should associate the .conf file type with a user friendly editor, i.e. anything other than the default Notepad.
      2. extra\httpd-vhosts.conf - contains directives that would allow you use your local server as virtual host. Simply put, during a development phase if you want to map the actual domain you are working for to your localhost, you would be able to do so by making minor tweaks in this file. We will discuss this in more detail below.

PHP setup

  1. Download PHP from and choose commonly VC6 x86 Thread Safe in Zip format. The various options have to do with how the PHP code base was compiled to binary and is probably nothing you should worry about for now.
  2. Create a folder under your C:\Program Files\ (or wherever your program directory is located) a folder called PHP.
  3. Locate your downloaded Zip file and move it to the newly created folder and unpack it directly into the folder.
  4. Let us now add the PHP path to our global PATH variable by following the instruction above

Configuring PHP

The configuration amounts to editing the php.ini file. A sample file for different scenarios are already in your PHP folder. Let us rename php.ini-development to php.ini and open it in your favorite text editor. The common values to tweak are as follows and all of these variables are well documented in the php.ini file (please note that this is a server wide setting applying to all your projects):

  • max_execution_time - whenever you have scripts that run for too long and the server returns various unexpected results which you think is due to not being able to run through the whole process
  • memory_limit
  • error_reporting
  • display_errors
  • log_errors - a variable you would need to take note of in production scenarios
  • upload_tmp_dir
  • upload_max_filesize
  • Dynamic extensions section contains various additional modules that you want to be loaded with, and the commented once are those that comes prepackaged with PHP and can be found in the ext directory in your PHP folder. If you want to activate any just remove the commenting as you should do with the following extensions:
    • php_curl.dll
    • php_gd2.dll
    • php_mbstring.dll
    • php_mysql.dll
    • php_mysqli.dll
    • php_pdo.dll
    • php_pdo_mysql.dll
    • php_xsl.dll
  • session.save_path

Configuring Apache to work with PHP

Now that we have configured PHP to work as we want it, lets go to Apache and do the same.

  • Open httpd.conf. and in the "Dynamic Shared Object (DSO) Support" section add the following directives (if you have located your PHP folder differently do make corresponding change for php5apache2_2.dll below):
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll" 
AddType application/x-httpd-php .php
  • In the DirectoryIndex add index.php as possible file to serve when directory is requested as follows
DirectoryIndex index.html index.htm index.php


  • At the end of the file add the following line which will point out where the php.ini file is located
PHPIniDir "C:/Program Files/PHP"

Installing and configuring xdebug