From:             bilo at mit dot it
Operating system: Linux
PHP version:      4.3.1
PHP Bug Type:     *General Issues
Bug description:  'ob_gzhandler' cannot be used twice: still present in 4.3.1 when 
using sessions

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

Reply via email to