Setup a WAMP (Windows, Apache, MySQL, & PHP) on Windows Vista

Setting up a development sever can be the best way to build and test your websites. You’ll be surprised how quickly you will get through this short installation and configuration process and have a fully functional development/testing server on your own machine.

NOTE: This tutorial is for setting up a PHP development environment using Apache and doesn’t support ASP.NET development. Please refer to Microsoft for more information about ASP.NET and Windows IIS.

Step 1:
Download Apache 2.2.11 for Windows (http://apache.deathculture.net/httpd/binaries/win32/apache_2.2.11-win32-x86-no_ssl.msi)
Download PHP for Windows (http://us2.php.net/get/php-5.2.10-win32-installer.msi/from/us.php.net/mirror)
Download MySQL 5 for Windows (http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.36-win32.msi/from/http://mirror.services.wisc.edu/mysql/)

Step 2:
We will be using Apache for the web server. Confirm that you do not have IIS (Internet Information Services) enabled in the Windows Features section of the “Add/Remove Programs” tool in the Control Panel.

Step 3:
Run the Apache .msi file you downloaded above. This will prompt you for:

* whether or not you want to run Apache for all users (installing Apache as a Service), or if you want it installed to run in a console window when you choose the Start Apache shortcut.
* your Server name, Domain name and administrative email account.
* the directory to install Apache into (the default is C:Program FilesApache GroupApache although you can change this to any other directory you wish)
* the installation type. The “Complete” option installs everything, including the source code if you downloaded the -src.msi package. Choose the “Custom” install if you choose not to install the documentation, or the source code from that package.

During the installation, Apache will configure the files in the conf directory for your chosen installation directory. However if any of the files in this directory already exist they will not be overwritten. Instead the new copy of the corresponding file will be left with the extension .default.conf. So, for example, if confhttpd.conf already exists it will not be altered, but the version which would have been installed will be left in confhttpd.default.conf. After the installation has finished you should manually check to see what in new in the .default.conf file, and if necessary update your existing configuration files.

Also, if you already have a file called htdocsindex.html then it will not be overwritten (no index.html.default file will be installed either). This should mean it is safe to install Apache over an existing installation (but you will have to stop the existing server running before doing the installation, then start the new one after the installation is finished).

After installing Apache, you should edit the configuration files in the conf directory as required. These files will be configured during the install ready for Apache to be run from the directory where it was installed, with the documents served from the subdirectory htdocs. There are lots of other options which should be set before you start really using Apache. However to get started quickly the files should work as installed.

If you eventually uninstall Apache, your configuration and log files will not be removed. You will need to delete the installation directory tree (”C:Program FilesApache Group” by default) yourself if you do not care to keep your configuration and other web files. Since the httpd.conf file is your accumulated effort in using Apache, you need to take the effort to remove it. The same happens for all other files you may have created, as well as any log files Apache created.

See http://httpd.apache.org/docs/1.3/windows.html for additional information on installation and customizing the configuration of Apache.

Step 4:
Run the MSI installer and follow the instructions provided by the installation wizard. You will be prompted to select the Web Server you wish to configure first, along with any configuration details needed.

You will then be prompted to select which features and extensions you wish to install and enable. By selecting “Will be installed on local hard drive” in the drop-down menu for each item you can trigger whether to install the feature or not. By selecting “Entire feature will be installed on local hard drive”, you will be able to install all sub-features of the included feature ( for example by selecting this options for the feature “PDO” you will install all PDO Drivers ).

Warning
It is not recommended to install all extensions by default, since many other them require dependencies from outside PHP in order to function properly. Instead, use the Installation Repair Mode that can be triggered thru the ‘Add/Remove Programs’ control panel to enable or disable extensions and features after installation.

The installer then sets up PHP to be used in Windows and the php.ini file, and configures certain web servers to use PHP. The installer will currently configure IIS, Apache, Xitami, and Sambar Server; if you are using a different web server you’ll need to configure it manually.

Now at this point you should have a fully functioning Apache web server that is capable of serving HTML and PHP. If you intend to setup database driven applications using PHP/MySQL continue on with Step 5.

Step 5 (optional):
Install MySQL.

See http://dev.mysql.com/doc/refman/5.1/en/windows-installation.html for more information and additional documentation.

Comments are closed.