php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #16745 HTTP_Compress should auto detect if output_handler = ob_gzhandler is in php.ini
Submitted: 2002-04-23 05:51 UTC Modified: 2003-01-18 16:55 UTC
From: daemorhedron at siliconjesters dot dyndns dot org Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.0 OS: mdk 8.1 smp
Private report: No CVE-ID: None
 [2002-04-23 05:51 UTC] daemorhedron at siliconjesters dot dyndns dot org
I was using chora 1.0 and cvs versions (2.0) and had this bizarre mem leak under either php4.2.0rc4 or php4.2.0 final. It would show up in the apache logs as

Last leak repeated 2 times
./zend_execute.c(1999) :  Freeing 0x0825CE0C (12 bytes), script=/www/sj/horde/chora/cvs.php
Last leak repeated 2 times
zend_operators.c(1047) :  Freeing 0x081EFCBC (31 bytes), script=/www/sj/horde/chora/cvs.php
Last leak repeated 1 time
zend_API.c(596) :  Freeing 0x081EF56C (44 bytes), script=/www/sj/horde/chora/cvs.php
zend_API.c(584) : Actual location (location was relayed)
zend_compile.c(1647) :  Freeing 0x0817CB6C (12 bytes), script=/www/sj/horde/chora/cvs.php

etc, etc.

I tried numerous compilations, etc. but in the end it turned out to be the fact that in my php.ini, I have output_handler = ob_gzhandler and chora would try to use the PEAR class to compress it again. I was able to turn that feature off within chora, but it was a bitch to track down, and odd how it would only show up in 4.2.0, but not in 4.1.2 even with the same ./configure setup.

It was suggested by a few that I report my findings, so I hope this helps. Perhaps the PEAR class could autodetect if gzip is already in use?

Keep up the great work as always!

PS. Just in case it helps somehow, here is my bitchin' configure line :

'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-config-file-path=/usr/local/apache/conf' '--enable-inline-optimization' '--with-pgsql' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-ftp' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--with-gdbm' '--with-gd' '--with-jpeg-dir=/usr/local/lib' '--with-png-dir=/usr/local/lib' '--with-tiff-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-swf=/usr/local/lib' '--with-pdflib=/usr/local' '--with-curl' '--with-xml' '--with-mcrypt' '--with-gettext' '--with-pspell' '--with-mm=/usr/local/lib' '--enable-debug'

I tried with and without --enable-inline-optimization and with and without --with-mm.

Send me an email if you need any more info, glad to be of help. Take care.

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 07:46 UTC] sander@php.net
Reclassified.
 [2002-04-23 09:42 UTC] yohgaki@php.net
We really need to make ob_gzhandler and PEAR HTTP_Compress a obsolete feature.

To reporter: use zlib.output_compression if you need compression...



 [2002-05-03 23:37 UTC] yohgaki@php.net
We can check if zlib.output compression is on or off. (zlib.output compressioin buffer is nest level 2)

Use of ob_gzhandler is not recommended, but this should be fixed.

 [2002-09-30 22:19 UTC] yohgaki@php.net
Make this a documentaion problem.

We need to document users are responsible for buffer usage. Including buffer dependecy/confulict, etc.

Detecting error could be too expensive when there are many buffers. Users can shoot themselves with their buffer, etc.
 [2003-01-18 16:55 UTC] philip@php.net
Documentation at ob_gzhandler() has been updated to reflect some of this behavior:

http://cvs.php.net/cvs.php/phpdoc/en/reference/outcontrol/functions/ob-gzhandler.xml

Now the PEAR docs may need some updating although I don't think this class exists anymore, at least I can't find it in CVS. I'm closing this bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 03:01:28 2024 UTC