1. Home
  2. Servers
  3. Upgrading PHP on Windows Server (IIS8)

Upgrading PHP on Windows Server (IIS8)

 

 

 

To get PHP7 installed on our server will break down the installation into a number of separate, logical step; these are as follows:-

  • Download the PHP binaries
  • Configure PHP in IIS

Downloading the PHP binaries

You can download the latest PHP binaries from the PHP website found here: http://windows.php.net/download/.

You must pay special attention to the version that you download, given that my server(s) run the 64-bit version of Windows, I will naturally choose to download and go for the x64 NTS (none-thread safe) version of PHP.

Once downloaded, extract all the files to C:PHP, this directory will be used to store our PHP binaries and configuration files.

Installing PHP

Now that we have the required runtimes installed and IIS has the CGI module enabled we can now start the final part of the setup and that is to install PHP!

Using the Administrative Tools found under the Control Panel again, this time we are going to open up the Internet Information Services (IIS) Manager application:

Now, from the left-hand menu click on the server’s name, and then from the main panel double click the Handler Mappings icon as shown below:

handler_mappings

You will now be presented with the current handler mappings supported by the server, on the right-hand side of the window you should see a list of Action links, click on the link named Add Module Mapping… as shown here:

add_module_mapping

Once the Add Module Mapping window appears, populate the values as follows:

PHP7_ModuleMapping

Click on the Request Restrictions button and tick the Invoke handler only if the request is mapped to: and then select the File radio button…

RequestRestrictions

Now click Ok and Ok again, the module mapping is now configured!

Although not mandatory, it is recommended that you now set a default document so that directory level access to pages will automatically serve the “index” page, it is common when serving PHP sites to have “index.php” configured as a default index page…

To set a new index page, select the server name from the left-hand menu and then double-click on the Default Document icon as shown below:

DefaultDocumentIcon

On the right-hand menu of the Default Document window you will have the option to add a new one, click the Add link, and then, in the window that pops up type index.php and then click Save as shown here:

AddDefaultDoc

Great stuff! – That’s it, adding a new site and add a index.php file into the root of the home directory should now work!

To test it out, create a file named index.php with the following content:

<?php phpinfo(); ?>

 

Updated on October 19, 2023

Was this article helpful?

Related Articles