IIS with PHP is not new now days, there is lots of business needs that requires php applications need to host in IIS. Recent times PHP improved a lots in terms of integrating to IIS.Still few times few things fall apart, like the problem we are going to illustrate.
For a recent project I had to configure PHP with IIS 7.0 on Windows 2008 R2. Everything was seems fine, I even added the application pool with “No Managed Code”, configured handler mapping and sit tight to see php running,.
As soon as I hit http://localhost/phpinfo.php and boom, I see this error message.
After lots of googling I find the solution at last, solution was super easy, you have to install Visual C++ Redistributable for Visual Studio from here. Though it was specifically mentioned in the php download section, but I some how skipped that and wasted hours to find a solution.
Problem was PHP as FastCGI with IIS requires you to install the Non-Thread Safe (NTS) versions of PHP. And Recent releases binaries built with Visual Studio 2012 compiler , So while executing you need to have Visual C++ Redistributable for Visual Studio 2012 install in your server where you are trying to execute php scripts. And for proper installation follow these steps. Addition to these instructions you have to add an application pool with “No Managed Code” and Managed Pipeline Mode set to “Classic”. Then Go to “Advance Settings” of newly created application pool and Enable 32bit Application value to “True”