×
Steps to Install PHP manually on Windows 2016 server
Blog Technologies

Steps to 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.

12 thoughts on “Steps to Install PHP manually on Windows 2016 server”

  1. Hi, I just installed following your cockbook – perfect!
    I have one problem left. I installed phpmyadmin and the mysqli is missing :/ – do you have an idea?
    I tried all tricks and settings …. no chance.

    regards

  2. Thanks for your tutorial ! But have problem after upgrade PHP on my Server 2016. On the “phpinfo” test page i receive an error 404.0 Not Found … Error code 0X8000700002 🙁 It’s possible to help me ?

  3. Thanks for this concise, clear outline. I just followed it and got it running on new Win 2016 server I have installed for test bed. One question. When I follow the link to get wincache, the IIS.NET supported versions page only lists up to PHP 7.1, so that is what I used for PHP and the wincache. I could not find wincache matching specs in this tutorial for PHP 7.2. Should I wait till the 7.2 version appears on the IIS.NET supported versions page? At any rate, I carefully followed your tutorial, and the PHPINFO file fired the very first time. Thanks. I am trying to develop my WordPress skills, and this test server will give me a safe place to test not on my production server.

  4. Excellent, concise tutorial. I followed it but using x64 versions, and it worked first time I tried PHPINFO. I have a question. PHP 7.2 has been in release for a year. The IIS.NET wincache extension page only lists links up to PHP 7.1. And on the SourceForge site linked to for download, I could not with confidence identify a 7.2 wincache version to download for Win 2016 IIS version. I am setting up a test server to migrate from MySql to MariaDB for WordPress blogs, and wanted to go with the latest versions of all software involved. Thanks again for such an excellent tutorial.

  5. that will be chosen appropriately depending on the application being
    made. Step 1 Design a Website – The first thing you
    have to do is design a website. Fashion designers usually are
    seen to utilize customized designing applications and tools depending on their project requirements.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.