ID: 23023
User updated by: mak77 at anvi dot it
Reported By: mak77 at anvi dot it
-Status: Feedback
+Status: Open
Bug Type: Output Control
Operating System: Windows XP
PHP Version: 4.3.2RC1
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2003-04-03 05:01:31] [EMAIL PROTECTED]
yeah, try lynx or wget or some other command line tool.
(NOT browser)
------------------------------------------------------------------------
[2003-04-02 13:41:01] mak77 at anvi dot it
could you give me some help for catching headers when the browser hangs
up?
------------------------------------------------------------------------
[2003-04-02 11:22:18] [EMAIL PROTECTED]
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 11:18:43] 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...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23023&edit=1