0
votes

I am working on a PHP application (running on an IIS server) and most of the pages work fine, but one of them throws the following error:

HTTP Error 500.0 - Internal Server Error
C:\[path to PHP]\php-cgi.exe - The FastCGI process exited unexpectedly

The PHP version I am on is 7.1.10x86. I've verified that FastCGI is configured correctly in my IIS server. The only error i see is in the Event Viewer and it looks like this:

Log Name:      Application
Source:        Application Error
Date:          
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      [machine name]
Description:
Faulting application name: php-cgi.exe, version: 7.1.10.0, time stamp: 0x59cab423
Faulting module name: VCRUNTIME140.dll, version: 14.16.27012.6, time stamp: 0x5bc12895
Exception code: 0xc0000005
Fault offset: 0x0000282e
Faulting process id: 0x5cdc
Faulting application start time: 0x01d60c369ee4b582
Faulting application path: C:[path to PHP]\php-cgi.exe
Faulting module path: C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll
Report Id: 7040cd3e-9ced-4579-8cbb-57aa2ecf72c2
Faulting package full name: 
Faulting package-relative application ID: 

How can I fix this?

1
Enable error logging through error_log in php.ini to determine what file and on what line gives you the error.Daniel Protopopov
0xc0000005 is the typical access violation in a native application. You will have to debug php-cgi.exe in order to learn more. However, keep in mind that PHP 7.1 is end-of-life php.net/supported-versions.php then you shouldn't waste your time on it and should upgrade now.Lex Li
@LexLi how can I debug php-cgi.exe? I am completely new to PHP. You may assume i know nothing about it.lukegf
You might get some hints from stackoverflow.com/questions/14502834/debug-php-cgi-exe-vb6-dll But debugging native memory issues is never an easy task for beginners.Lex Li
There was nothing in the php error log about this error and i ended up not needing to debug php-cgi.exe. However, with help from my team I was able to figure out what was causing it. It had to do with xDebug.lukegf

1 Answers

0
votes

The error was caused by xDebug versions mismatch. I had installed the latest version of xDebug, but unbeknownst to me, parts of the application (but not the entire application) expected a lower version. Hence, some of the pages worked while others didn't.

So in order to resolve the problem i had to downgrade my version of xDebug to the one expected by the application, and to update my php.ini so the settings would correspond to the xDebug and PHP versions.