Steps To Install PHP Manually On Windows 2016 Server

Install PHP Manually On Windows 2016 Server

Steps to Install PHP manually on Windows 2016 server

In this blog, we will show the steps to install PHP manually on Windows 2016 server.

REQUIREMENTS

  • Virtual Machine
  • IIS Web Server
  • WinCache Extension for PHP
  • PHP Binary Files
  • VC++ Compiler

INSTALLING IIS

  • Open the Windows PowerShell and type the below command to install IIS service with CGI extension.

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

Install PHP manually on Windows 2016 server
  • It will take few minutes to complete the installation.
Install PHP manually on Windows 2016 server
Install PHP manually on Windows 2016 server
  • Once the installation is completed, verify the CGI feature was installed in the server using the below command.

Get-WindowsFeature web-cgi

Install PHP manually on Windows 2016 server

INSTALLING PHP

  • Go to the below URL to download the PHP 7.1 version.

http://windows.php.net/download/

Install PHP manually on Windows 2016 server
  • Extract the ZIP file to C:\program files folder.
Install PHP manually on Windows 2016 server
  • There will be two PHP.ini files are available in that folder. Rename the php-.ini-development to php.ini.
Install PHP manually on Windows 2016 server
  • Open the php.ini file Add the following line at the end of the file.

extension=php_wincache.dll

Install PHP manually on Windows 2016 server
  • Save and close the php.ini file.
  • Right-click on the windows start menu and click on system.
Install PHP manually on Windows 2016 server
  • Click on Advanced system settings.
Install PHP manually on Windows 2016 server
  • Click on Environment Variables.
Install PHP manually on Windows 2016 server
  • Under System Variables, select path variable and click on Edit.
Install PHP manually on Windows 2016 server
  • Click on New button and add the PHP binary path.
Install PHP manually on Windows 2016 server
  • Click OK thrice to close the system properties window.

INSTALL WINCACHE EXTENSION

  • Browse the below URL to download the Wincache extension for PHP.

https://www.iis.net/downloads/microsoft/wincache-extension

Install PHP manually on Windows 2016 server
  • Scroll down and download WinCache 2.0 for PHP 7.1 under download section.
Install PHP manually on Windows 2016 server

Note : In this demo, we are installing PHP 7.1, so we are downloading corresponding wincache version

  • Once you download, double-click on the wincache-2.0.0.8-dev-7.1-nts-vc14-x64.exe file and extract the files to a folder.
Install PHP manually on Windows 2016 server
Install PHP manually on Windows 2016 server
Install PHP manually on Windows 2016 server
  • Copy the php.wincache.dll file to C:\Program Files\php-7.1\ext folder.
Install PHP manually on Windows 2016 server

CONFIGURE PHP IN IIS

  • Open IIS snap-in and click on the server name.
Install PHP manually on Windows 2016 server
  • Double click on Handler Mappings icon.
Install PHP manually on Windows 2016 server
  • Click on Add Module Mapping… under actions menu.
Install PHP manually on Windows 2016 server
  • Provide the below information as shown below. And click on Request Restrictions, under Mapping make sure you have select the File or Folder button.
Install PHP manually on Windows 2016 server
  • Click OK twice to close configuration window. Now the PHP will be listed under Handler Mappings List.
Install PHP manually on Windows 2016 server
INSTALLING VC++
  • Browse the below URL and download the Microsoft Visual C++ 2015 Redistributable Update 3 RC package.

https://www.microsoft.com/en-us/download/details.aspx?id=52685

image
  • Click on Download and select vc_redist.x86.exe and click Next.
image
  • Once the download is complete, double-click on the vc_redist.x86.exe file. Accept the License Agreement and click on Install button.
image
  • Once the installation is successful click on close button.

VERIFYING PHP

  • To Verify the PHP extension, place a file named phpinfo.php in your root folder of IIS website and add the below lines in that file.

<?php
phpinfo();
?>

Install PHP manually on Windows 2016 server
Install PHP manually on Windows 2016 server
Install PHP manually on Windows 2016 server
VIDEO

Thanks for reading this blog. We hope it was useful for you to learn to install PHP manually in windows 2016 server.

Loges