#22698 [Com]: 'ob_gzhandler' cannot be used twice: still present in 4.3.1 when using sessions

From: Date: Wed, 09 Apr 2003 01:54:52 +0000
Subject: #22698 [Com]: 'ob_gzhandler' cannot be used twice: still present in 4.3.1 when using sessions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37398@lists.php.net to get a copy of this message
 ID:               22698
 Comment by:       dave at toad dot net
 Reported By:      bilo at mit dot it
 Status:           Open
 Bug Type:         Session related
 Operating System: Linux
 PHP Version:      4.3.1
 New Comment:

For what it's worth, I have session.use_trans_sid = 0 and I am
getting:

[Tue Apr  8 21:48:31 2003] [error] PHP Warning:  (null)() [<a
href='http://www.php.net/ref.outcontrol'>ref.outcontrol</a>]:
o
utput handler 'ob_gzhandler' cannot be used twice in Unknown on line 0

This is with current horde/imp; I am not aware that the ob_gzhandler is
being invoked anyplace in particular.


Previous Comments:
------------------------------------------------------------------------

[2003-03-17 03:59:33] bilo at mit dot it

Yes it did, thank you.

------------------------------------------------------------------------

[2003-03-14 11:13:09] sniper@php.net

So did it 'fix' this problem or not?


------------------------------------------------------------------------

[2003-03-14 10:34:24] bilo at mit dot it

Ok.

I'll try.

BTW ... Why? And what does setting this parameter to
off changes for me in the way I write scripts and pages ?

I see that a cookie with PHPSESSID is still sent. Does
this mean that I have to add "&PHPSESSID=xxxxxxx" to each
URI when cookies are not available?

------------------------------------------------------------------------

[2003-03-14 09:53:31] sniper@php.net

Set session.use_trans_sid = 0 in your php.ini.


------------------------------------------------------------------------

[2003-03-14 05:50:44] bilo at mit dot it

Since I've upgraded to php 4.3.1 I'm getting the following error with
my scripts using ob_gzhandler:

Warning: (null)() [ref.outcontrol]: output handler 'ob_gzhandler'
cannot be used twice in Unknown on line 0

The wierd thing is that I was getting the warning just when opening the
page for the first time, while subsequent ones where ok. 

I've lurked across the archive. There's the claim that that problem had
been fixed but imho it has not been fixed completely (see below). As a
workaround I've found that I've to check if some other handler is
loaded before trying to compress. I did it and I'm no longer getting
that error.

By the way I don't know who is starting that handler!


In my configuration I've set:

  output_buffering        = Off
  output_handler          =
  zlib.output_compression = Off

The following script reproduces the problem:

<?
    session_start();

    $_SESSION['N'] =  (isset($_SESSION['N']) ? ++$_SESSION['N'] : 1);

    echo "Level = " . ob_get_level() . ";<br>";
    echo "Iteration = " . $_SESSION['N'] . ";<br>";
?>

The first time it's launched I get "Level = 1".
From the second iteration on, I get "Level = 0".


It looks like that starting a session makes an ob handler start.

Is this behaviour correct?

I'm using RedHat Linux 6.2 with kernel 2.2.18, glibc-2.1.3-28,
gcc-2.96-98, apache 1.3.27 and php 4.3.1.
This is my "configure" line:

./configure \
    --with-apxs=/usr/sbin/apxs \
    --with-config-file-path=/etc/httpd/conf \
    --with-java=/usr/java/jdk1.3.1_02 \
    --disable-cgi \
    --with-tsrm-pthreads \
    --enable-trans-sid \
    --enable-sysvsem \
    --enable-sysvshm \
    --with-zlib \
    --with-ssl=shared \
    --with-dom=shared \
    --enable-xslt=shared \
      --with-xslt-sablot \
    --with-curl=shared \
    --with-gd \
      --with-jpeg-dir \
      --enable-gd-native-ttf \
      --enable-gd-imgstrttf \
    --with-mysql=shared \
    --with-recode=shared \
    --enable-calendar \
    --enable-dba=shared \
      --with-gdbm \
      --with-ndbm \
      --with-cdb \
      --with-db2 \
      --with-flatfile\
    --with-kerberos


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=22698&edit=1



Thread (9 messages)

« previous php.bugs (#37398) next »