Installing PHP 7 on IIS Server 2016
This guide will take you through installing PHP7 on Server 2016.
I have had success using the IIS web platform components installer, but lately some requirements get left behind and things don’t work, so this is a quick and dirty manual guide.
So what’s needed, hop over to
Also required is the Visual C++ Redistributables for visual Studio, PHP based on VC14 requires the redistributables indicated below.
When PHP and the VC Redist package is downloaded Install the
Fastcgi_impersonate = 1
cgi.fix_pathinfo = 0 (zero)
extension_dir = “ext”
errorlog = “c:\php7\php_errorslog”
Timezone = UTC (Or your time zone)
Enabling PHP Modules.
Further down the php.ini file we need to “un” comment loadable module that php requires to function
Un comment out following lines under Dynamic Extensions; then save the file. These are the minimum required if using a CMS with MySQL.
Add PHP to the Environment Variable Path statement
Click Environment Variables…
Select Path and then Edit…
Select New, this allows you to input a new “path variable” into the path, Type C:\PHP7
If desired you can move the new entry up the list. This will put it closer to the start of the Path variable, but is not necessary.
Click OK, OK, OK.
A quick check that things are on track can be achieved by opening PowerShell and typing php –info
If you get a screen full of output, like below, then things are looking good
Install IIS ensuring the CGI option is selected
Some features may need the Server OS DVD in the drive or the ISO mounted if doing this in a Virtual Machine as an alternate source path is needed to be specified for some features. The scrip
Add a Module Mapping
Once IIS is installed, open up IIS Manager and open the Handler Mappings.
Double click Handler Mappings
On the right-hand side menu, select Add Module Mapping…
Fill in the required information
Select Request Restrictions…
On the Mapping Tab
On the Verbs Tab
On the Access Tab
Click OK, OK
When presented with the CGI application notification
Restart the Server
When the server is back up and running, create a text file
Save this file in the Inetpub\wwwroot folder as Index.php ensure there is no .TXT extension. When saving the file as shown
Add Index.php top the IIS Default Document list.
Open IIS Manager, select the Server, and then select Default Document
Double click Default Document
Click Add…In the Add Default Document type Index.php, click OK
The new default document will appear in the list of documents.
Now it’s time to test our install. Open a web browser and go to
That’s it, your server is now configured to deliver pages using PHP…..