Upgrading PHP Versions on Windows Server 2008 and IIS
- Download latest zip file from http://windows.php.net/download/
- If you are using IIS use the Non-Thread Safe (NTS) version
- Also at the same site download and install the Vc11 or Vc9 Visual C++ Redistributable for Visual Studio (it won't work without it)
- Unzip the PHP download to whatever directory you want to run it from (c:\php or anywhere you like)
- Update the path to the new PHP directory in your Environment Variables (Control Panel, System, Advanced System Settings, Environment
Variables, Path). Also if you have a PHPRC path in the same place update that as well
- Rename the php.ini-production file in the new PHP directory to php.ini
- (if you upgrading from an older version be careful to keep all the setting in the old php.ini to the new one)
- For running on IIS these must be set:
- cgi.force_redirect = 0
- cgi.fix_pathinfo = 1
- fastcgi.impersonate = 1
- See this website for details: http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis
- Uncomment any new extensions you want to use in the new php.ini. In my case I needed LDAP so I uncommented extension=php_ldap.dll
- In you website directory create a file called test.php and include this in it (then view it in a web browser)
- Change IIS to point to the new version of PHP
- Open IIS Manager. At the server level, double-click Handler Mappings
- click on PHP_via_FastCGI then click Edit in the right column
- Change the path to the new PHP (if it contains spaces use double quotes around the path) click OK
- Where it asked Do you want to create a FastCGI application ... click Yes
- fastcgi.impersonate = 1
- Restart you server
- Now open the file you created in step 7 in a web browser and see that the newer version should now be working