WAMP setup on Win XP Pro

My web hosting package is LAMP (Linux, Apache, MySql, PHP4), but my laptop runs Windows XP. Here is how I got a WAMP (Windows, Apache, MySql, PHP) environment for development at home.

Update: since I first wrote this, PHP5 has gone stable, so there are some useful instructions at Webmasterworld. My web hosting account still runs on PHP4, so the instructions below are still valid for replicating an environment like that:

To get a WAMP (Windows, Apache, MySql, PHP) environment working under Windows XP, this is what I did:

The instructions on gizmobytes were good – here are my additions:

Get Apache 2.0.53

Change install directory to C:\Apache2

Open a browser window. Type

http://localhost

– and you should get the Apache Installation Test Page

Get PHP 4.3.10

Unzip to C:\PHP

Edit the C:\Apache2\Apache2\conf\httpd.conf file to support the php sapi file; display index.php for directories;

Run “Apache | Restart”

Create a text file – save as C:\Apache2\Apache2\htdocs\phpinfo.php, which should contain the following:

< ?
phpinfo();
?>

This will show that PHP is working with apache.

Download mySql from mysql.com

Unzip and install to C:\mysql

Save the enclosed file to C:\windows\my.ini

#This File was made using the WinMySQLAdmin 1.4 Tool
#21/12/2003 00:16:23

#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions

[mysqld]
basedir=C:/mysql
#bind-address=127.0.0.1
datadir=C:/mysql/data
#language=C:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/mysql/bin/mysqld-nt.exe
user=nick
password=newpass

Get PHPMyAdmin from sourceforge

Unzip it to C:\Apache2\Apache2\htdocs\phpMyAdmin

Save the enclosed file to C:\Apache2\Apache2\htdocs\phpMyAdmin\config.inc.php

From a browser, type:

http://localhost/phpMyAdmin

You should see something like

MySQL 4.1.10-nt running on localhost as nick@localhost

Save the following to C:\Apache2\Apache2\htdocs\mysql\sqlconnect.php

In the browser, type:

http://localhost/mysql/sqlconnect.php

– you should see a list of users in the browser window: i.e.”nick”, “root”.

Once this is all working, that should give you enough of a guide to add your own users etc. (suggest through phpmyadmin), and edit the scripts. Helpful apache and php fora (forums?) on webmasterworld