|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-03-30 22:38 UTC] myronwu at gmail dot com
Description:
------------
In certain browsers, attempting to output data before a
call to ob_start('ob_gzhandler', chunk_size) causes
Apache 2 to consume huge (all) amounts of memory. This
only occurs when chunking takes place (ie size of data
output > chunk_size).
Outputting data before a call to ob_start without a
chunk_size or without 'ob_gzhandler' works as expected.
Browsers tested that were affected: Firefox, Opera
Browsers tested that were unaffected: Links
Diff between php.ini and php.ini-dist:
register_globals = On
Apache version:
Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7a PHP/
5.0.3
using prefork mpm.
Zlib version: 1.1.4
PHP configure command:
'./configure' '--with-mysqli=/usr/local/mysql/bin/
mysql_config' '--with-mysql=/usr/local/mysql' '--with-
apache2=/usr/src/apache/httpd-2.0.53' '--enable-yp' '--
enable-track-vars' '--with-zlib' '--with-jpeg' '--with-
png' '--with-tiff' '--with-pdflib' '--with-gd' '--with-
apxs2=/var/www/bin/apxs' '--with-gettext' '--with-
pspell'
This was also reproduced on another box with the same
versions of Apache 2, zlib, but PHP 4.3.1 with configure
command:
'./configure' '--with-mysql=/usr/local/mysql' '--with-
apache2=/usr/src/httpd-2.0.46' '--enable-yp' '--enable-
track-vars' '--with-zlib-dir=/usr/local/lib' '--with-
jpeg-dir=/usr/local/lib' '--with-png-dir=/usr/local/lib'
'--with-tiff-dir=/usr/local/lib' '--with-pdflib' '--
with-gd=yes' '--with-apxs2=/var/www/bin/apxs'
Reproduce code:
---------------
<?php
echo 'test!';
ob_start('ob_gzhandler', 2048);
phpinfo();
ob_end_flush();
?>
Expected result:
----------------
test! (phpinfo() output)
Actual result:
--------------
Nothing. The browser doesn't receive any information to
display and httpd begins to consume all available
memory.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Let me clarify some more, here's some more ob_start calls that you can substitute into the reproduce code given: These work OK: ob_start(); ob_start(null, 2048); ob_start(null, 1024); ob_start('ob_gzhandler'); These don't work: ob_start('ob_gzhandler', 1024); ob_start('ob_gzhandler', 2048); ob_start('ob_gzhandler', 1);