×
Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016
Blog Technologies

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

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

 

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

11 thoughts on “Steps to resolve 500 Internal Server Error for PHP in IIS on Windows 2016”

  1. Thanks a lot Loges. Your information was so clear ! I can fix the problem just in five minutes. Congratulations for your blog.

  2. Okay, this seems like a nice start, but where’s the part for how to debug/fix the 500 error problem when the PHPINFO part at the beginning of this article works perfectly, but the server nevertheless generates a 500 error for any other script… Even with straight html files (with no internal php) that are renamed with a “.php” extension…

  3. hello, php -m command returns no errors but 500 internal server error still persists. thanks.

  4. Hi,
    I have configure as given instruction but while browsing phpinfo.php showing error 400 in browser
    Can you please help me out.
    Thanks
    Mahendra

Leave a Reply

Your email address will not be published.

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