How to resolve 500 Internal Server Error for PHP in IIS on Windows 2016. 

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

<?php
phpinfo();
?>

  • 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.
  • Make sure that PHP was configured correctly in IIS.
  • Open IIS snap-in and click on the server name.
    • Double click on Handler Mappings icon.  
  • You can see the list of handlers configured in that server. Double click on the PHP handler.
    • Make sure that php-cgi.exe was added as executable in IIS (Edit and select "Exicutable") .
  • Open the command prompt and go-to PHP binary folder. In this demo, it is C:\program files\php 7.1 folder.
    • 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 error.
    • If it showing  "VC_RUNTIME140.DLL (Visual C++)  is missing". , then google Visual C++ and go to microsoft website, download latest version .
  • 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

  • Click on Download and select vc_redist.x86.exe and click Next.
    • Once the download is complete, double-click on the vc_redist.x86.exe file. Accept the License Agreement and click on Install button.
    • 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.
  • Browse the info page again and you will able to see the PHP configuration information. (The page we created  at first step )
Was this answer helpful? 26 Users Found This Useful (2081 Votes)