Steps To Resolve 500 Internal Server Error For PHP In IIS On Windows 2016

Resolve 500 Internal Server Error For PHP

Steps to Resolve 500 Internal Server Error for PHP in IIS on Windows 2016

In this blog, we will show you the steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016.

ACCESSING PHP INFO PAGE

  • To troubleshoot this issue, place a phpinfo page under your website home folder.

<?php
phpinfo();
?>

Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Open the web browser and access the URL http://localhost/phpinfo.php and if you see the 500 Internal Server Error. Follow the below steps.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016

VERIFY THE IIS HANDLER MAPPING

  • Make sure that PHP was configured correctly in IIS.
  • Open IIS snap-in and click on the server name.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Double click on Handler Mappings icon.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • You can see the list of handlers configured in that server. Double click on the PHP handler.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Make sure that php-cgi.exe was added as executable in IIS.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016

VERIFYING PHP MODULES

  • Open the command prompt and go-to PHP binary folder. In this demo, it is C:\program files\php 7.1 folder.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Type the below command to view the available modules in the PHP.

php –m

  • If PHP dependencies are installed correctly it will show the list of available modules in PHP or it will show the error like below.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • It looks like Visual C++ is missing on the server. Google the VC++ and install it.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • 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

Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Click on Download and select vc_redist.x86.exe and click Next.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Once the download is complete, double-click on the vc_redist.x86.exe file. Accept the License Agreement and click on Install button.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Once the installation is successful click on close button.
  • Verify the PHP modules from the command prompt again. Now you will able to see the list of modules available in PHP.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • Browse the info page again and you will able to see the PHP configuration information.
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
  • So, PHP requires MSVC++ as a compiler to execute the coding.
VIDEO

Thanks for reading this blog. We hope it was useful for you to learn to resolve the PHP 500 internal server error in IIS

Loges