After a fresh installation of IIS 8.5 on Windows Server 2012 with PHP 5.5 via Microsoft Web Platform Installer 5.0, attempting to execute any PHP script results in HTTP 500 errors. The PHP Manager's configuration check reveals this critical error:
Module: FastCgiModule
Error Code: 0xc0000135
Handler: PHP55_via_FastCGI
The error code 0xc0000135 typically indicates a missing DLL dependency. In PHP's case, this often means:
- VC++ Redistributable not installed or corrupted
- Architecture mismatch (x86 vs x64)
- PATH environment variable issues
1. Verify VC++ Redistributables
For PHP 5.5, you need Visual C++ Redistributable for Visual Studio 2012 (v11.0):
# PowerShell command to check installed VC++ versions Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object {$_.DisplayName -like "*Visual C++*"} | Select-Object DisplayName, DisplayVersion
2. Repair Architecture Mismatch
Ensure your PHP build matches IIS Application Pool architecture:
# Command to check IIS app pool architecture Import-Module WebAdministration Get-ChildItem IIS:\AppPools | Select-Object name, enable32BitAppOnWin64
3. Validate FastCGI Configuration
Check applicationHost.config (located in %windir%\system32\inetsrv\config):
<handlers>
<add name="PHP55_via_FastCGI" path="*.php" verb="GET,HEAD,POST"
modules="FastCgiModule"
scriptProcessor="C:\PHP\php-cgi.exe"
resourceType="Either" />
</handlers>
Enable detailed error logging in php.ini:
display_errors = On display_startup_errors = On error_reporting = E_ALL log_errors = On error_log = "C:\PHP\logs\php_errors.log"
For IIS-level logging, modify the web.config:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
</configuration>
- Forgetting to restart IIS (
iisreset /noforce
) after configuration changes - Incorrect NTFS permissions on PHP directory (IIS_IUSRS needs read/execute)
- Multiple conflicting php.ini files (use
php --ini
to verify loaded file)
If issues persist, consider manual PHP installation:
# Download PHP 5.5 Thread-Safe version https://windows.php.net/download#php-5.5 # Extract to C:\PHP # Run as Administrator: icacls C:\PHP /grant "IIS_IUSRS:(OI)(CI)(RX)"
When setting up PHP on IIS (Internet Information Services), encountering a 500 Internal Server Error with error code 0xc0000135
typically indicates a dependency issue with the FastCGI module. This specific error often occurs when critical DLL files are missing or incompatible.
From my experience administering Windows servers, these are the most frequent causes:
- Missing Visual C++ Redistributable packages
- Incorrect PHP handler configuration in IIS
- Permission issues with the PHP installation folder
- Corrupted PHP installation
First, let's verify the FastCGI settings in IIS:
// Check FastCGI application settings in applicationHost.config
// Typically located at: C:\Windows\System32\inetsrv\config\applicationHost.config
<fastCgi>
<application fullPath="C:\PHP\php-cgi.exe"
arguments="-d open_basedir=none"
monitorChangesTo="php.ini"
activityTimeout="600"
requestTimeout="600"
instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
</environmentVariables>
</application>
</fastCgi>
The error code 0xc0000135 specifically suggests missing runtime components. Here's what to install:
- Visual C++ Redistributable for Visual Studio 2012 (vcredist_x86.exe and vcredist_x64.exe)
- Visual C++ Redistributable for Visual Studio 2015-2022
After installation, reboot the server - this is crucial for changes to take effect.
Create a simple test.php file with the following content:
<?php
phpinfo();
?>
If this still returns a 500 error, try running php-cgi.exe directly from command prompt:
C:\PHP\php-cgi.exe -v
This will often reveal more detailed error messages than IIS provides.
Ensure the IIS_IUSRS group has proper permissions:
icacls "C:\PHP" /grant "IIS_IUSRS:(OI)(CI)RX"
icacls "C:\inetpub\temp" /grant "IIS_IUSRS:(OI)(CI)RX"
If Web Platform Installer fails, try manual installation:
- Download PHP from windows.php.net
- Extract to C:\PHP
- Run this command to register PHP with IIS:
%windir%\system32\inetsrv\appcmd.exe set config /section:system.webServer/fastCgi /+[fullPath='C:\PHP\php-cgi.exe']
Enable detailed error logging in php.ini:
error_log = "C:\PHP\error_log"
log_errors = On
error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
And in IIS, enable Failed Request Tracing for more detailed diagnostics.
After making all these changes, create a new test file with:
<?php
echo 'Hello IIS!';
?>
If this works, gradually add more complexity to your scripts while monitoring the error logs.