Problem: PHP will not start on IIS
"FastCGI process exited unexpectedly"
You installed PHP, mapped the handler, opened the first page, and IIS answered with a 500 error, this sentence and a hexadecimal code. It is the most searched PHP-on-Windows error there is, and it almost never means what it says. PHP did not crash for no reason; it could not start, and IIS is the only one reporting it.
Part of the Server setup module, £99 £49.50 per server for twelve months. 30-day money-back promise.
See PHP's real error in ten seconds
IIS hides the reason. PHP will tell you if you ask it directly. On the server, open a command prompt in the PHP folder and run:
php-cgi.exe -v
If it prints a version, PHP itself starts and the problem is the handler mapping or php.ini. If a dialog or message appears about a missing DLL, that is your answer. The four usual causes:
- 0xc0000135, a missing Visual C++ runtime. Windows builds of PHP need the Microsoft Visual C++ Redistributable matching the compiler they were built with, shown on the download page. Without it PHP cannot load at all. This is the cause nine times out of ten.
- The wrong build. IIS needs the Non Thread Safe (NTS) x64 build. A Thread Safe build, or a 32-bit build under a 64-bit application pool, starts and dies.
- A broken extension. A line in php.ini enabling an extension that does not exist, was built for a different PHP version, or is loaded before the one it depends on, crashes PHP on start with 0xc0000005 or a similar code.
- The handler points at the wrong place. PHP was moved or upgraded into a new folder and the FastCGI mapping in IIS still names the old php-cgi.exe, or PHPRC points at a php.ini that no longer exists.
Fix it by hand
- Install the Visual C++ Redistributable named on the PHP download page for your build, x64.
- Confirm the build is NTS x64 and matches the application pool.
- Run php-cgi.exe -v again. If it complains about an extension, comment that line out in php.ini and retry until it starts, then fix the extension list properly.
- In IIS Manager, check the FastCGI Settings and the handler mapping name the php-cgi.exe you actually have.
- Recycle the application pool and load the page again.
What ServerMaid does
Installed so it starts first time
The runtime PHP needs
The Visual C++ runtime that Windows builds of PHP depend on is installed or updated before PHP is, so you never see this error on your first page load.
The right build, verified
The current NTS x64 release of the PHP line you choose, from windows.php.net, checked against its published SHA-256 before it is unpacked.
Extensions in order
OPcache on and the extensions common applications need enabled in the right order, dependencies first, in a php.ini built from php.ini-production rather than edited by hand.
FastCGI done right
Registered in IIS with instance limits, request recycling, timeouts and PHPRC set, and the php.ini watched for changes, so the handler restarts cleanly instead of serving a stale configuration.
Tested before you see it
The validation suite tests PHP through a temporary diagnostic website that is removed afterwards. A PHP that cannot start fails the deployment loudly.
Plain English if it ever happens
"PHP cannot start because a required Microsoft Visual C++ runtime appears to be missing", with a button to install it. The Windows error code is one click away.
Questions about PHP errors on IIS
Which Visual C++ runtime does PHP need?
The one named on the windows.php.net download page for your build. Recent PHP lines are built with Visual Studio 2019 or later and need the corresponding x64 Redistributable. ServerMaid installs the right one before PHP.
Thread Safe or Non Thread Safe for IIS?
Non Thread Safe. IIS runs PHP through FastCGI, which does not need the thread-safe build and runs faster without it.
The page works sometimes and fails sometimes. Is that the same error?
Usually not. Intermittent FastCGI failures are more often a timeout or a request limit set too low in the FastCGI settings, or an application pool recycling under memory pressure. The error text is similar; the fix is in the FastCGI and pool settings.
Can ServerMaid fix an existing PHP install?
It reports what it finds and leaves a PHP it did not install alone. The reliable route is to let ServerMaid install and manage its own PHP for the websites it runs, side by side with anything already there.
How are PHP updates handled afterwards?
PHP patch releases and database updates are managed: the previous version is parked, the new one installed and verified, and rollback puts the old one back if anything fails.
Never search for a hexadecimal code again
The Server setup module installs IIS, PHP and the database the way a specialist would, verifies every package, and explains any problem in a sentence with a button.