Installing IIS, PHP and MySQL on a Windows XP Professional


Install IIS

  1. Insert your Windows XP Professional CD into your computer. When it auto runs, choose “Install optional Windows components”
  2. In the window that opens, scroll down the list until you find “Internet Information Services (IIS)” and tick the box next to it.
  3. Click “Next” then wait whilst Windows installs IIS.
  4. Click “Finish” and then close the CD window.

Install MySQL

  1. Download the Community version of MySQL from here:
  2. I recommend downloading the Windows ZIP / Setup.exe version.
  3. Once the file has downloaded, unzip it and run the executable.
  4. Click “Next”, then choose “Complete” and click “Next” again.
  5. Click “Install” and wait whilst MySQL installs.
  6. Click “Next” twice then make sure the “Configure the MySQL Server now” box is checked and click “Finish”
  7. The “MySQL Server Instance Configuration Wizard” should now open. Click “Next” to begin the process.
  8. Chose “Detailed Configuration” and click “Next”
  9. Chose the best server type. If you are testing applications on your home box “Developer Machine” will be your best option. Click “Next”
  10. Chose “Multifunctional Database” and click “Next”
  11. Chose which drive you want the Tablespace to save to. You can probably just choose the default here. Click “Next”
  12. Chose the amount of concurrent connections your server will have. If you are running a developer machine, the first option, “Decision Support (DSS)/OLAP” will be best. Click “Next”
  13. Check all tick boxes and click “Next”
  14. Chose “Best Support For Multilingualism” and click “Next”
  15. check all tick boxes and click “Next”
  16. Make sure “Modify Security Settings” is checked and enter a new password for the root account twice. Make this password complex and make a note of it somewhere safe. You can check “Enable root access from remote machines” if you need this functionality.
  17. Make sure “Create An Anonymous Account” is unchecked and Click “Next”
  18. Click “Execute”, all four stages should receive a tick, if they do not you will need to review what configurations failed and go back and correct the problems.
  19. Click “Finish” to exit the wizard

Install PHP

  1. Download the latest version of PHP from I recommend downloading the zip package not the installer
  2. Make a new folder on the root of your C drive called “PHP”
  3. Extract all the files in the zip file you just downloaded to this new folder
  4. Copy the php.ini-dist file and paste it into the C:\PHP folder, rename it to php.ini
  5. Open php.ini and change the following lines:
  1. About a third of the way down the file change the “extension_dir” setting to point to your PHP extension directory e.g. “C:\PHP\ext”
  2. About half way down the page you will come to the “Dynamic Extensions” section; un-check the following extensions: php_gd2.dll, php_mysql.dll and php_mysqli.dll
  3. About three quarters of the way down change the “session.save_path” variable to your Windows Temp directory e.g. C:\WINDOWS\Temp
  4. Save the file and close it

Add PHP to the Path

We now need to let Windows know where PHP and MySQL are installed. We do this by adding their location to the Windows Path variable

  1. Right click “My Computer” and choose “Properties”
  2. Click “Advanced” tab and click the “Environment Variables” button
  3. In the “Systems Variables” window scroll down until you find the “Path” entry
  4. Highlight it and click “Edit”
  5. Add “C:\PHP;” to the end of the Path entry.
  6. Click “OK”
  7. Click on “New” in the “System Variables” section.
  8. Enter the variable name as “PHPRC” and the variable value as “C:\PHP”
  9. Click “OK” three times and then restart your PC

Configure IIS to use PHP

  1. Open the Windows Control Panel > Administrative Tools > Internet Information Services
  2. In the tree view, expand the entry labelled “Local computer”, the under web sites look for “Default Web site”. Right click on the site and choose properties.
  3. Click on the “ISAPI Filters” tab then click “Add”
  4. Enter the filter name as “PHP” and then click browse for the executable
  5. Navigate to “ C:\PHP “ and select “php5isapi.dll”, click “Open”
  6. Click “OK” then click “Apply”
  7. Click on the “Home Directory” tab and make sure “Execute Permissions” is set to “Scripts Only”.
  8. Click on the “Configuration” button then click “Add”
  9. For extension enter “.php” and for Executable clikc “Browse” and navigate to “ C:\PHP “ and chose “php5isapi.dll”, you will need to change the “Files of type” drop down to *.dll first.
  10. Click “OK” twice
  11. Click the “Documents” tab and click the “Add” button
  12. Type “index.php” and click “OK”
  13. Highlight “index.php” and move to the top of the list using the arrow buttons to the left.
  14. Click “OK” until you are back to the IIS Management Window
  15. Click “Start” then “Run”
  16. Type “iisrest” and press “Enter”
  17. Now open notepad and type “<?php phpinfo(); ?>
  18. Save the file as info.php in “C:\Inetpub\wwwroot”
  19. Open your web browser and type http://localhost/info.php as the address
  20. All being well you will now see all the information about your PHP version displayed.

Check PHP and MySQL are communicating

  1. Open notepad again and type the following, remembering to change the password for the password you set for root when installing MySQL.


$dbconnect = @mysql_connect(‘localhost’, ‘root’, ‘mypassword’);

if (!$dbconnect) {

echo ‘<p>Unable to connect to the database server!</p>’ ;


} else {

echo ‘<p>Successfully connected to the database server!</p>’;



  1. Save the file to “C:\Inetpub\wwwroot” as “connect.php
  2. Open your web browser and visit http://localhost/connect.php
  3. If you are presented with the message ‘Successfully connected to the database server!’, then you have set everything up.

3 thoughts on “Installing IIS, PHP and MySQL on a Windows XP Professional

  1. Great information! I’ve been looking for something like this for a while now. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *