From:             mak77 at anvi dot it
Operating system: Windows XP
PHP version:      4.3.2RC1
PHP Bug Type:     Output Control
Bug description:  output_buffering problem with IE 6.0

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...
-- 
Edit bug report at http://bugs.php.net/?id=23023&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23023&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23023&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23023&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23023&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23023&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23023&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23023&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23023&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23023&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23023&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23023&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23023&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23023&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23023&r=gnused

Reply via email to