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:
- 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.
- Download the latest version of PHP. Download the PHP installer version found under Windows Binaries.
- Run the downloaded MSI install pacakge to install PHP on your server. When asked what web server version to install select IIS FastCGI.
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
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.
- Check out the official PHP.NET install guide for windows.