« Previous Next »

Thread: IIS7 -FastCGI -PHP White Screen of Death

Last post 03-10-2009 8:49 PM by gusus. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 03-06-2009, 11:59 PM

    • gusus
    • Not Ranked
    • Joined on 03-06-2009, 11:36 PM
    • Posts 3

    IIS7 -FastCGI -PHP White Screen of Death

    I am having an issue with IIS7 and PHP relating to clients receiving the white screen of death (blank page) after 90 seconds of processing.  Standard php processing works fine.  

    The following are set in php.ini:

    max_execution_time = 180
    max_input_time = 180
    memory_limit = 128M

    In the FastCGI configuration on IIS I have the following:

    ActivityTimeout 900
    IdleTimeout 300
    RequestTimeout 500

    I have a simple page that runs through loop and sleeps every 15 seconds.  If I set the max_execution_time to 30 seconds, I get the php execution time exceeded error as I should with two entries in the page. If I manually set_time_limit(0), it gives the white page of death.  I have set php logging and nothing appears in the log.  I intentionally put a syntax error to make sure and the syntax error was logged.  In addition, I can set the ActivityTimeout to 10 and IIS gives me a 500 error telling me that the FastCGI process exceeded the configuration activity timeout.

    The weird thing is the Failed Request Tracking show that the time taken was 30592 msec with a status of 200 (I assume success).  However, the last entry in the request trace is "FASTCGI_WAITING_FOR_RESPONSE"...

    Any ideas???

  • 03-09-2009, 1:06 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: IIS7 -FastCGI -PHP White Screen of Death

    What was your failed request tracing rule?  My guess is that you set a rule with max execution of 30secs in which case, no event after 30s will be in the trace.  The best way to catch all events is to just use status-code 200-999 as condition for failure.  Your symptoms however indicate that the client is timing out.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 03-09-2009, 9:19 PM In reply to

    • gusus
    • Not Ranked
    • Joined on 03-06-2009, 11:36 PM
    • Posts 3

    Re: IIS7 -FastCGI -PHP White Screen of Death

    Thank you for catching that.  Yes, my rule for the FRT was for 30 seconds.  I made the change you suggested but still not error.  The time taken is now 150135 msec, which is right for the code that I am running (For loop going 0-9, sleeping every 15 seconds). 

    The "GENERAL_RESPONSE_ENTITY_BUFFER" in the FRT shows the HTML that should be rendered, however the content in the browser is blank.  The browser stops processing after 90 seconds and shows a blank page.  Which I guess is correct because the script is still running...

    To eliminate my firewall, I ran the code from the server and it did the same thing (both IE and Firefox.)  Do you think this could have something to do with a setting in Server 08?  All users are experiencing this same issue, regardless of their location, inside or outside of the network.

     Thanks for your help.

  • 03-10-2009, 12:51 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: IIS7 -FastCGI -PHP White Screen of Death

    So, this does look like a browser timeout which you would have to configure at the browser.  People usually get around this sort of browser timeout by periodically sending a "wait for response" response while computing the final response.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 03-10-2009, 8:49 PM In reply to

    • gusus
    • Not Ranked
    • Joined on 03-06-2009, 11:36 PM
    • Posts 3

    Re: IIS7 -FastCGI -PHP White Screen of Death

    Anil,

    Thank you for your assistance.  In my 10+ years of PHP development on Apache and IIS, I have never encountered an issue like this where all browsers (IE, Firefox, Chrome) all exhibit the same issue of showing a blank page after 90 seconds.  Technically, Chrome gives a message of "This website might be temporarily down or it may have moved permanently to a new web address."

    Your idea gave my an avenue to pursue and I have found a resolution to the issue.  The following posting helped also: http://forums.iis.net/t/1078563.aspx.

    For any others having this issue, I had to set the responseBufferLimit property to "0" on the FastCGIModule add line in the local web.config and the CGIModule add line in the applicationHost.config file.  I also had to turn "On" implicit_flush and set output_buffering to "0" in my php.ini file.

    Again, thanks for your help.

Page 1 of 1 (5 items)
Microsoft Communities