Easy steps to install PHP on Windows Server 2016

This tutorial was create for Windows Server 2016 x64, but you can do it on Windows Workstation x86, but you just need to use x86 everywhere.



  • Windows Server 2016
  • IIS
  • PHP bin files
  • WinCache
  • VC++

IIS service with CGI extension.#

Before to install, verify if you already have it.

2Get-WindowsFeature web-cgi

Powershell command to install

2Install-WindowsFeature -name web-server,web-cgi –IncludeManagementTools

Installing PHP#

Download PHP version you want to install.


Extract file to C:\Program Files\php

Select PHP configuration to use#

You have 2 configuration files:

  • php.ini-development
  • php.ini-production

You must rename the file configuration to php.ini.

Add Wincache configuration#

Open php.ini file and add this line in the end:


Add PHP path on Environment variables#

On Explorer click properties on This PC

Click on Advanced system settings

Click on Advanced \ Environment Variables

On System variables, edit variable : Path

Add new path. ( C:\Program Files\php )

Install WinCache Extention#


Download and extract it.

Copy files to folder : C:\Program Files\php\ext

  • php_wincache.dll
  • php_wincache.pdb       (optional)

Configurate PHP in IIS

In IIS open Handler Mappings

Add Module Mapping

  • Request path : *.php
  • Module : FastCgiModule
  • Executable (optional) : C:\Program Files\php\php-cgi.exe
  • Name : PHP

Click on Request Restriction…

Select “FIle or Folder”

Installing VC++#


Just install it.

Verify if it works.

Open the default web site path, root, and create a file <phpinfo.php> with this line:

<?php  phpinfo(); ?>

Usually it is this path: C:\inetpub\wwwroot

Open in your local server this page: