Genuine troubleshooting screenshot/photo pending. No illustrative or generated image is used.
?>The problem
A PHP application on IIS returns HTTP 500/502, FastCGI process errors or blank pages.
Recommended approach
Check bitness, php.ini, extension_dir and required modules (zip/sqlsrv/mysqli/mbstring/gd as used). Temporarily enable protected FastCGI stdout/application logging, reproduce one failure, read first fatal error, then disable verbose logging. Keep display_errors Off publicly.
Step-by-step checklist
- Capture the exact symptom, error and affected scope.
- Run the read-only diagnostic commands and save output.
- Identify the first failing dependency.
- Apply only the narrow correction supported by evidence.
- Verify the original operation from the affected endpoint.
- Record rollback and monitor for recurrence.
Before you begin
Applicable to supported Windows Server/client environments where the named role or feature is installed. Run read-only checks first from an elevated PowerShell or Command Prompt as appropriate. Replace example hostnames, domain names, addresses, ports and paths with values from the affected environment. Record the exact error, timestamp, OS build and scope of impact.
Production safety: obtain change approval and a verified backup before modifying AD DS, DNS, DHCP, firewall, IIS, storage or Hyper-V configuration. Ensure console/out-of-band access before network or remote-access changes.
Symptoms and likely root cause
A PHP application on IIS returns HTTP 500/502, FastCGI process errors or blank pages.
Wrong php-cgi.exe, mismatched architecture, different php.ini, missing extension DLL/VC runtime, permissions or PHP fatal error.
Diagnostic commands
%windir%\system32\inetsrv\appcmd list config /section:system.webServer/handlers
php-cgi.exe -v
php-cgi.exe -m
php --ini
php -i | findstr /I "Loaded Configuration File extension_dir"Run the commands in order and save the complete output. The commands above are intended to establish the failing layer before a configuration change is attempted.
How to interpret the results
Run PHP diagnostics from the exact executable configured in IIS FastCGI, not an unrelated CLI install. Compare IIS log sc-status/substatus/win32-status, Handler Mappings and FastCGI executable path.
Practical correction
Check bitness, php.ini, extension_dir and required modules (zip/sqlsrv/mysqli/mbstring/gd as used). Temporarily enable protected FastCGI stdout/application logging, reproduce one failure, read first fatal error, then disable verbose logging. Keep display_errors Off publicly.
Make one change at a time. Re-run the failed diagnostic after each change so the cause-and-effect relationship is clear.
Fallback and recovery
Restore known-good php.ini/handler mapping if failures increase. Do not upgrade PHP in place on production without staging. Remove temporary phpinfo/health page after verifying runtime/extensions.
Verification checklist
Success: PHP request uses intended runtime, required extensions load, application workflow succeeds and IIS logs show no new 500/502.
- Repeat the original failing operation from the affected client/user or service.
- Test from a second approved endpoint or subnet where relevant.
- Review the relevant event log/IIS log after the fix.
- Record the change, actual result and any remaining limitation.
Frequently asked question
Why can CLI PHP work while IIS fails? IIS may use another executable, php.ini, bitness, identity or extension path.
Official technical reference
Use the official documentation for exact version support, prerequisites and any procedure that differs between Windows Server releases.
Technician field note
This runbook describes a controlled diagnostic path; it is not a universal guarantee that every environment has the same cause. If evidence does not match the expected result, stop and investigate rather than applying unrelated fixes. Do not mark the incident resolved until the original symptom is verified as cleared.
Need this solution implemented?
Share your current setup, error message, number of users or site requirement. We can discuss the practical next step.
Talk to an Expert →