Setting Up a WAMP System

30 November -0001
September 14, 2005

WAMP (Windows,Apache,MySQL,PHP) configurations are especially common for me as a PHP developer. On a Windows XP Pro workstation, it is an easy ways for me to quickly emulate a production environment for testing. Installing a WAMP system is relatively quick and painless except for a few caveats.

The first step to installing your WAMP system is to download Apache2 from The MSI installer works quite well. The only thing I'd recommend doing is perhaps changing the default installation directory. One good idea is to create a new directory called 'web' or perhaps 'wamp' where you can put all your WAMP component programs for easy access.

Once you've got Apache installed you should install PHP. This step is a little tricky. The best installation method is the 'manual' install. Download the windows binary .zip package from in the downloads section. Simply unzip the package into the appropriate folder. This will give you maximum flexibility. PHP doesn't necessarily have to be installed. If you don't choose to run it in CGI mode then you simply have to inform Apache that you're using PHP and give it the right directives to find the program parts it needs to process .php files.

Open up your httpd.conf file (the Apache configuration file) and in the LoadModule section add the following lines:

# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

This is assuming your PHP is installed in C:\php. Update the paths as necessary for your installation. Once this is updated you should move on to the MySQL installation.

MySQL can be installed quickly and easily using the MSI installer from the downloads section under the developer section of The installer will ask a series of questions designed to customize your installation to your liking. Next update PHP to utilize MySQL. Update your php.ini file to change the extension_dir directive to point to the right directory and include the php_mysql.dll in the loaded modules:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\PHP\ext\"
;extension_dir = "./"

Once MySQL is installed it's time to take care of a few 'gotchas' in the installations:


- Make sure you only have one php.ini file. If you attempt the install more than once, or if you attempt the MSI install before the manual install you may find an additional php.ini folder in your WINDOWS directory.

- You must copy the libmysql.dll from the PHP installation folder to your SYSTEM32 folder or when you start Apache you'll get an error like "unable to load dynamic library" with the path to your php_mysql.dll (even though the path will be correct).

- You may want to add or update the max_allowed_packet directive in your my.ini file (the MySQL configuration file) to allow for a lager limit, especially if you plan to do any work with binary files.

- If you install Apache or MySQL as a system service be sure to update your firewall settings. You should be especially careful to limit connections to the MySQL TCP/IP port (default of 3306).