PHP 5 with IIS 7 on Windows Server 2008 Tutorial

A few years back I wrote a simple tutorial on how to install and configure PHP5 with IIS6 on Windows Server 2003 in five easy steps. Back then things were not as straight forward as they turned out to be when I tried it again today on a different server setup.
The following worked like a charm on my Windows Server 2008 SP2 Standard Edition to install and configure PHP 5.2.10.

This tutorial presupposes that you have your Windows Server 2008 up and running with IIS (Internet Information Services) configured.

So this time I’m down to four easy steps for installing PHP:

  1. For reasons unknown to me ISAPI is no longer an option so make sure you have activated CGI support on your Windows Server, it is not done by default. Open up Server Manager, select Roles from navigation tree, and under Role Services click Add Role Services and make sure Web Server – Application Development – CGI is checked.
  2. Download the latest version of PHP. Download the PHP installer version found under Windows Binaries.
  3. Run the downloaded MSI install pacakge to install PHP on your server. When asked what web server version to install select IIS FastCGI.
  4. Done!

To test your PHP installation simply create text a file with the php extension, eg. test.php. Add the following three lines of text to it and then save it to your web site directory, eg. C:\INETPUB\WWWROOT. Then use your browser to read the file, eg. http://localhost/test.php

<?php
phpinfo();
?>

Some other tips:

  • If you want to use PHP with MySQL (or any other extensions) make sure you click this option when you install. Don’t worry if you miss it you can run install again at a later time to reconfigure.
Published
Categorized as PHP

1 comment

Leave a comment

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