Installing PHP on a Windows machine is quite simple, expecially if you rely on the official setup packages or (even better, if you’re using IIS) the great PHP Manager tool available through the Web Platform Installer, which we already mentioned here.
However, as soon as you install it and try to execute your first php page, it’s very common to be struck with a 500 error. They can be quite different depending on your script, but the most common ones are this one:
C:\Program Files (x86)\PHP\v5.6\php-cgi.exe – The FastCGI process exited unexpectedly
and this one:
Faulting application name: php-cgi.exe, version: 126.96.36.199, time stamp: 0x53fe294e
Faulting module name: MSVCR110.dll, version: 6.3.9600.18233, time stamp: 0x56bb4e1d
Exception code: 0xc0000135
Fault offset: 0x0009d3c2
Faulting process id: 0x44c
Faulting application start time: 0x01d2628b1f0bdff2
Faulting application path: C:\Program Files (x86)\PHP\v5.6\php-cgi.exe
Faulting module path: MSVCR110.dll
Report Id: 5cb86ba6-ce7e-11e6-80ca-005056021679
If you’re experiencing the former, we already talked about quite some time ago: the latter can sound different, but the cause (and thus the fix) is basically the same. You need to install Visual C++ Redistributable for Visual Studio 2012 Update 4 (or newer): when you do that, be sure to get the x86 / 32-bit version, even if you have a 64-bit operating system: you need to install the 32-bit version because PHP is still a 32-bit application.
Here’s the download link: http://www.microsoft.com/en-us/download/details.aspx?id=30679
Once you install that, you’ll be good to go.
UPDATE: Since the launch of the x64, experimental version of PHP 5.6 (and above) this post requires the following update: if you’re using an 64-bit PHP build, you have to install the 64-bit Visual C++ package, available through the same download link mentioned above. As the two packages can coexist without hassles, our suggestion for 64-bit based installations is to install both as long as x64 PHP builds will be marked as “experimental”, so you’ll be able to switch back to the x86 version whenever you need to.