500 The FastCGI process exited unexpectedly

Recently at work, I’ve came across the error “500 The FastCGI process exited unexpectedly” error code: 0xc0000005, trying to execute a PHP script on an IIS6 and IIS7 server. Knowing how annoying it was to resolve and how many people have the same problem, I thought I would answer your questions.

The problem is caused by excessively requiring more memory than is allocated to your script, which depending on the version of PHP you are running, defaults between 8 and 128 megabytes. To work out how much memory your script is actually using, you should log usage at all points in your script (especially in large loops), this can be done using the functions:

memory_get_usage(true)

and

memory_get_peak_usage(true)

These will return values in kilobytes, so calculate that into megabytes and then increase the memory limit for that script using ini_set()

ini_set("memory_limit","1024M");

Obviously setting the amount of megabytes, to what you need. You should now be able to run your script without any problems 😀

3 Love This

Leave a Reply

Your email address will not be published.