FastCGI Error RRS feed

  • Question

  • User-1664798565 posted
    Hey guys,

    I've been struggling for a few days trying to get the FastCGI Handler & PHP to work properly on IIS6. I've searched high and low and have read many posts on this site with issues similar to mine, but have been unable to come up with a resolution. PHP is installed and working great by itself, but when I enable FastCGI I get the following error:

    FastCGI Error
    The FastCGI Handler was unable to process the request.
    Error Details:
    The FastCGI process exited unexpectedly
    Error Number: -1073741819 (0xc0000005).
    Error Description: Unknown Error
    HTTP Error 500 - Server Error.
    Internet Information Services (IIS)

    I don't get this on every page, only about 1 in 10-15 pages. It's entirely random. I can refresh a single page 10 times, 9 of which will work and the 10th will receive the above error. Then, with one more refresh the problem goes away for another few page requests. I can't for the life of me figure out what's going on, and why it does this at random. One page will work fine, while the next time its loaded it will get the error.

    Here's what fcgiext.ini looks like:



    The PHP version we are using is 5.2.9-2. I've tried upgrading to the latest 5.2 build, but still have the same problem. I've also tried both thread safe & non thread safe versions. Same thing. Any help or insight is greatly appreciated! Thank you in advance!

    Edit: I should also mention we're running Windows Server 2003 Standard (SP2) 32-bit.
    Thursday, April 7, 2011 11:58 AM

All replies

  • User-1672167363 posted


    Question are you using the non-thread safe version of the MSI installer? The best choice is the non thread safe version.

    You need to update to latest version of PHP Engine this is critical for Security for IIS Server & your system.

    Question do you have the Visual Studio Runtime(s) for Visual Studio 2005,Visual Studio 2008 ?

    Question did you add the IUSR,IIS_USERS to Web Server & Web Sites ?

    You will find most of your issues start with fixing above.

    Post answers & questions to this thread.




    Thursday, April 7, 2011 12:24 PM
  • User-1664798565 posted

    Hi Martin,

    First of all thanks for the quick response. To answer your first question, I have tried both the thread-safe and non thread-safe version of PHP, both produce the same error, randomly.

    I have tried the latest non thread-safe compile of PHP (5.2.17) with FastCGI and still get the same random error. FastCGI will work for nine out of ten pages, then suddenly exit. It can't be a coding problem because the same page will load perfectly fine, then the next FastCGI will crash.

    The Internet Guest Account (IUSR) has appropriate permissions on the web site, and the Visual C++ 2005 & 2008 redistributables are both installed.

    This really baffles me because of the fact that it works fine for 9 out of 10 requests. Then the 10th it suddenly quits. I thought it might be something with the recycling for the app pool, however I have also tried every different combination (including shutting off recycling completely), still to no avail.

    I don't want to upgrade to PHP 5.3 yet, as there is some testing that needs to be done before jumping to that version.

    Thursday, April 7, 2011 12:35 PM
  • User-1672167363 posted


    Ok So the normal stuff appears to be done.

     So the "Elephant of causes is done so now to the Ant". (^ ^).

    Since your getting execution errors which might still be related to items not normally handled.

    To track down causes by Monitoring the Application Pool  as the code is in operation.

    Good tool for this is Process Monitor from system internals. 

       You should get the Process Monitor and look at IIS Server logs and maybe you will be able to find who,what is at fault.



    Thursday, April 7, 2011 3:30 PM
  • User-1664798565 posted

    Hi Martin,

    Thanks again for the response. I've looked at the server logs and unfortunately they show nothing that's of any use. As for Process Monitor I'm not quite sure how to go about monitoring the application pool or what I'm looking for...

    Do you have any idea as to why a single page would execute N number of times, then receive the fastcgi error after so many tries? It doesn't make sense to me... If it works 14 times, why wouldn't it work the 15th time?

    For example, I've created a PHP page with nothing more than <?php phpinfo(); ?>. If I navigate to the page and press refresh so many times, I will eventually get that error. It can't be in the PHP code that's causing the problem. I don't know where to look anymore!

    Thursday, April 7, 2011 4:26 PM
  • User-1672167363 posted


    Here look here   http://www.iislogs.com/articles/processmonitorw3wp/ this is a guide for Process Monitor.

    The thought is use the Process Monitor to find a pattern for the failures.

    Example: Process Monitor was used to find that an Anti-Virus was preventing execution

    of  vb scripts as part of the Rules for Anti-Virus. The delay caused the vb scripts to crash.




    Thursday, April 7, 2011 6:27 PM
  • User-1664798565 posted
    Thanks again for your help Martin. I started peeking around with Process Monitor and didn't get too far because the work day ended and I'm not back until Monday. When Monday comes I'll post how I make out with your advice. Thanks again for everything!
    Thursday, April 7, 2011 7:54 PM
  • User-1664798565 posted

    Ok so I've given this another shot to try and figure out why FastCGI isn't working properly, but still no success. I used process monitor to watch the application pool closely as the error happens, but still can't figure out what's going on. Here's the log from the monitoring:


    or the original image: http://www.nickelfault.com/temp/procmon.jpg 

    There are roughly 7 page refreshes in that log, the last of which failed with the "The FASTCGI process exited unexpectedly" message. If you look at the end of the log, there is nothing that signifies something went wrong (at least from what I can tell).

    I'm out of ideas at this point, I can't figure out why the fastcgi process keeps exiting. Any other ideas?

    Monday, April 11, 2011 2:24 PM
  • User-1672167363 posted


    Could you instead of posting images export the errors as a text file and then post the selected text to the Forum.

    The images are of no use for checking errors and looking for problems.

    You should check what your Application Pool Frame Work is set to and which type ie. Classic and Net version 2.0 or 4.0.





    Monday, April 11, 2011 2:59 PM
  • User-1664798565 posted

    Sorry I didn't realize you could save the log in CSV format. We're using the .NET 4.0 framework for the application pool. Here's the (CSV) log file of another run:


    Thanks again for your help!


    Monday, April 11, 2011 3:17 PM
  • User-1672167363 posted


    Thanks for the log I will check it out. It may take awhile.

    Mean time try the Net 2.0 Framework Classic type and see if the Failures change.



    Monday, April 11, 2011 3:47 PM
  • User-1664798565 posted

    I've finally got a copy of the VM that is used as our company's web server for testing purposes. It is an exact replica of the production server. For some reason I am unable to reproduce this error when I am testing within the local environment, which leads me to believe it only occurs when multiple people are hitting the server simultaneously. I'm having a rediculously hard time figuring out what exactly is going on.

    It's not that the server load is crazy when people are browsing pages on the server, usually only a few people every couple seconds. Any clue as to why the handler would crash when several users are connecting at once?

    Wednesday, April 20, 2011 6:04 PM
  • User-1672167363 posted


    If the problem is with users then maybe the problem is sessions related

    one way to check this would be look at the location where the PHP are  sessions are stored and look

    at date / time for the sessions along with the number.

    If the number does not track current number of users you may have a problem with logon or user permissions. 

    If the problem is with caching or recycling of scripts / pages you could check IIS Server settings for cache / recycling

            time and number tweak the setting  while monitoring what changes .

    You also might check the IIS Server settings for Session Mode for number of sessions.




    Wednesday, April 20, 2011 6:40 PM
  • User-1672167363 posted


    I found that the commons errors your getting in the modified machine are from

    trying to access missing links and files.

    When the IIS Server was relocated to  different drive location the default pages and links were not changed.

    Your errors are references to C:\inetPUB\wwwroot and that no longer exists for your current set-up on drive D:\.

    The way to fix this is check the default pages for the site and modify.




    Wednesday, May 4, 2011 12:15 AM