php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23023 output_buffering problem with IE 6.0
Submitted: 2003-04-02 11:18 UTC Modified: 2003-04-03 12:20 UTC
From: mak77 at anvi dot it Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.2RC1 OS: Windows XP
Private report: No CVE-ID: None
 [2003-04-02 11:18 UTC] mak77 at anvi dot it
ok so here is my problem

my php.ini is set to

output_buffering = On
output_handler = ob_gzhandler
zlib.output_compression = Off
;zlib.output_handler =

and i have a script (content management system similar to php-nuke), it's a very big pile of code so i cannot put here it all.

hwv... the script has mainly an API that is a class..
the part of interest is

class API
{
      var $_OB=true;
      var $_OB_HANDLER='ob_gzhandler';
      function API()
      {
        if(ini_get('zlib.output_compression')) $this->_OB_HANDLER='';
        if(!ini_get('output_buffering') && $this->_OB) {ob_start($this->_OB_HANDLER);}
        if(!$this->_OB && ini_get('output_buffering')) {$this->_OB=true;}
      }

      ... other code
}

a page is build as 
   $API->page_start(); //html headers and module initialize
   //contents here
   $API->page_end();

the problem is that having output_buffering=on often the browser stay "stuck" waiting for the page (and i have to refresh to get the page), while other times it renders the page immediately.

the problem totally disappear if i set output_buffering=off in the php.ini file (i can do this on my pc but not on provider's server!)

so i've tried to put this code in $API->page_end (the last function called)

          if($this->_OB) {
                                //$page=ob_get_contents();
                                $page=ob_get_contents();
                                $fp=fopen("debug.txt","w");
                                fwrite($fp,var_export(ob_get_status(true),true)."\n\n".$page);
                                fclose($fp);
                                ob_end_flush();
                         }

the scripts reach the end (a debug.txt file is created correctly) but the page is not always displayed (1 time works correctly, 1 time the browser wait for something and do nothing)

the debug.txt file contains:

array (
  0 => 
  array (
    'chunk_size' => 0,
    'size' => 61440,
    'block_size' => 10240,
    'type' => 1,
    'status' => 0,
    'name' => 'ob_gzhandler',
    'del' => true,
  ),
)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="IT" lang="IT" dir="ltr">

 <head>
 
... and so on

Browser is IE 6.0 sp1, works correctly with mozilla 1.2, so is probably some header's problem.
Same problem with phpMyAdmin 2.4.0
server is IIS 5.1, php installed as an isapi filter
waiting for some help if possible, i'll try to create a little script to reproduce the problem...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-02 11:22 UTC] sniper@php.net
Please tell us what headers are output when you run your script? (And I'm pretty sure this is IE6 bug and not PHP bug)

 [2003-04-02 13:41 UTC] mak77 at anvi dot it
could you give me some help for catching headers when the browser hangs up?
 [2003-04-03 05:01 UTC] sniper@php.net
yeah, try lynx or wget or some other command line tool.
(NOT browser)

 [2003-04-03 06:59 UTC] mak77 at anvi dot it
taken with wget from the main page 

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Thu, 03 Apr 2003 12:51:31 GMT
Content-type: text/html
X-Powered-By: PHP/4.3.2-RC
Set-Cookie: PHPSESSID=a146a67ef3e8414fb39375c9ab96379e; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

this is a page that doesn't have the problem, it seems to me that this kind of problem happens after a call to 
header("location:someurl");

for example i have a select form (get method) that changes the theme, it pass a variable to the same page (localhost/neo3/index.php?module=mainpage) with the name of the new theme. The page reads the variable, set appropriately the session and then calls 
header("location:localhost/neo3/index.php?module=mainpage");
The page should restart, catch the info from the session and change theme appropriately, but it works only half of the times on IE with buffering enable, full times on Mozilla.
 [2003-04-03 10:03 UTC] mak77 at anvi dot it
i've tried with opera 7.0, no problem.
so this is a IE6 only bug

closing this report cause it seems not a php bug...
 [2003-04-03 12:20 UTC] sniper@php.net
Not PHP bug -> Bogus.

And I can say the same myself, I'm just fighting with some
really weird IE6-only problem too..(not related to this one)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC