Updating PHP in IIS 8

I spent the morning updating PHP on our IIS server and ran into a few snags. The process is not difficult. You just download the new version of PHP, place it in a separated folder, and then register the new version in the IIS manager. I required using Microsoft’s SQLSRV driver for PHP and this caused some headaches in the process.

(1) DOWNLOAD

  1. Download the new version of PHP from the PHP website. You should use the non-thread safe version as threading requires a bit more expertise to use. Also, use the x86 unless the x64 version has been tested and is already in use. http://windows.php.net/download/
  2. Download the correct version of the SQLSRV driver from Microsoft that matches the PHP version you are using.
    http://www.microsoft.com/en-us/download/details.aspx?id=20098 http://php.net/manual/en/book.sqlsrv.php

(2) PRELIMINARY CHECKS

  1. Check and make sure that you have the correct version of VC++ (Visual C++) for the version of PHP you will be using installed on the computer. If not, install it. To check, open the Control Panel -> Programs -> Programs and Features. You should see the program installed. For VC++11, you would see “Microsoft Visual C++ 2012 Redistributable (x86) – 11.0.60610”.

  2. Check and make sure that you have the correct version of the ODBC driver that corresponds with the SQL Server. System Requirements (Microsoft Drivers for PHP for SQL Server) https://msdn.microsoft.com/en-us/library/cc296170.aspx
    1. To check the ODBC SQL Server driver version (32-bit ODBC)
      1. In Control Panel, double-click ODBC Data Sources.
      2. Click the Drivers tab. Information for the Microsoft SQL Server entry is displayed in the Version column.

(3) INSTALLATION

  1. Create a folder in the current PHP folder for the new version. ( C:\Program Files (x86)\PHP\v5.6.13 ) and copy the files into the folder. Copy the dll files for the sqlsrv driver into the “ext” folder.

  2. Copy the “php.ini-production” file and name “php.ini”. We need to copy all the current settings into this file. Make sure to add the correct extension for the sqlsrv driver file (as downloaded above). Copy all the settings.

  3. Open the PHP Manager in the IIS Manager for the site you want to upgrade. Under “PHP Setup”, click on “Register new PHP version” and select the “php-cgi.exe” file in the folder of the new version.

(4) TEST

Test to make sure everything is working properly.

  • Is PHP running?
  • Can you connect to the MySQL database and the Microsoft SQL database?
  • Can you connect to LDAP (if needed)?
  • Does the website appear?
  • Can you login to the different systems installed on the site?

(5) ADDITIONAL If possible, download and install the WinCache Extension for PHP.
http://sourceforge.net/projects/wincache/files/
http://www.iis.net/downloads/microsoft/wincache-extension

Leave a Reply

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