So what do you need to do? Well, firstly, download the latest build of PHP for your system (download the NTS version, which is the non-thread safe version). Extract it somewhere on your system i.e. c:\PHP or wherever you mostly feel comfortable. Next, assuming that you are using either Windows Server 2008 or 2008 r2, go to your Server Manager console, and then click 'Roles' on the right. Next, click the link on the left named 'Add role services' under the Web Server (IIS) heading. This is assuming that you have IIS already setup on your server, otherwise you will need to add this as a role to your server. Drop down the 'Application Development' box and check the 'CGI' box as shown below.
Ok, your PHP config. Do what you would normally do here. In addition to your normal PHP config which can mostly be copied from your old PHP 5.2 config you will need to change the following:
- fastcgi.impersonate = 1
- cgi.force_redirect = 0
- extension_dir = 'c:\PHP\ext' *or where you have your PHP extension folder*
- open_basedir = *location of your wwwroot folder typically*
Click on your server on the left hand side. In the central pane will be an icon called 'Handler Mappings'. Click on that, and then go to 'Add module mapping' in the right hand pane. Fill in the following details and click 'OK', and then 'Yes' in the popup box when you are finished:
- Request path: *.php
- Module: FastCgiModule
- Executable: *Link this to your PHP folder and then your php-cgi.exe file*
- Name: PHP FastCGI
Nearly there now. Make yourself that old PHP test file with the following information: <?php phpinfo(); ?> and see if it runs. Chances are if you are on a 64 bit system this will have failed unless you tell IIS to use 32-bit applications. To change this, go to the Application Pools, and then go to your website in the central pane. Click 'Advanced settings' and then a popup box will appear. Change the 'Enable 32-bit applications' entry to 'True'.
Assuming that you have set up the rest of your php.ini correctly, it's a case of job done for now!