RSS
 

PHP intermittent blank page

30 Mar

There is a problem with IE and PHP applications is certain instances where an intermittent blank page appears instead of the expected content.

This seems to relate to an earlier bug reported by Microsoft with IE 6 where the content length was reported as 0 during POST requests. This occured when browsing sites running UNIX/Apache with keepalive enabled. However, I’ve discovered that the same problem occurs intermittently with certain PHP applications and GET requests.

One workaround which solves the problem (although with a performance hit) is to create an .htaccess file in the root directory with the following setting:

[code]
BrowserMatch "MSIE" nokeepalive downgrade-1.0 force-response-1.0

SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
[/code]

This workaround disables keepalive for all IE 6 clients. I imagine this would have a negative performance effect, however it is likely preferable to a buggy application.

I haven’t been able to determine if certain PHP code techniques could be causing the problem. I read certain people presuming that it could be session related, however, i went as far as removing all session functionality from an application, however it did not solve the problem.

 
4 Comments

Posted in *NIX, Apache, PHP

 

Leave a Reply

 
Please leave these two fields as-is:
 
  1. Joeri

    April 30, 2007 at 5:37 am

    This problem (intermittent blank pages on form submits) can also appear when using client-side certificates on IIS (regardless of what browser you’re using). The solution in that case turns out to be the two settings on this page:
    http://technet2.microsoft.com/windowsserver/en/library/0ef55842-24d2-4060-bb98-d69e2877a6671033.mspx?pf=true

     
  2. Jason

    April 30, 2007 at 1:19 pm

    Thanks Joeri. I haven’t been experiencing that as much anymore, but just recently IE7 started to give me grief whenever I reload a page with a certain application. I don’t know if it’s because of the javascript library being used or something. I tried the solution you posted but it didn’t have an effect unfortunately. oh well, luckily it only happens on localhost, but it is incredibly annoying when you’re trying to test a page!

     
  3. Learn PHP

    October 7, 2007 at 6:20 pm

    I have had problems with secure pages on IIS. This seems to solve the problem

     
  4. Learn PHP in 24 Hours

    July 19, 2010 at 5:34 pm

    Perfect! Thanks!