php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12907 Callback causes apache to hang
Submitted: 2001-08-22 15:01 UTC Modified: 2001-12-12 04:41 UTC
From: gregm at onlinecreatorinc dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 4.0.6 OS: RedHat 6.2 / Linux 2.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gregm at onlinecreatorinc dot com
New email:
PHP Version: OS:

 

 [2001-08-22 15:01 UTC] gregm at onlinecreatorinc dot com
I have a problem using a callback function with ob_start, causing apache httpd instances to hang, and remain for a very long time. Each instance was using 2-4 % cpu and was causing apache to launch new processes to keep up server demand, then those servers were hanging, etc, and I was seeing an average load up in the 50-70 range (vs around 1.0 normally)

Basically:

<?

function obCallback($buffer) {
   return str_replace("hello", "hi", $buffer);
}

ob_start("obCallback");

echo "hello there";

ob_end_flush();

?>

was causing problems. I've gotten around it by using ob_get_contents then ob_end_clean and just using my function on the contents.

my configure line for php is:

'./configure' '--prefix=/usr/local' '--with-apache=/root/apachetoolbox/apache_1.3.20' '--enable-exif' '--enable-track-vars' '--with-calendar=shared' '--enable-safe-mode' '--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--with-gd' '--with-zlib' '--enable-gd-native-tt' '--with-t1lib=/usr/local/lib/php/t1libs' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--with-ttf' '--with-freetype-dir' '--with-imap' '--with-mhash' '--with-mcrypt' '--with-unixODBC=/usr/local/unixODBC' '--with-pdflib=/root/apachetoolbox/src/pdflib-3.03' '--enable-shared-pdflib' '--with-snmp=/usr/local/snmp' '--with-openssl' '--with-curl=/usr/local' '--with-bcmath' '--with-mysql=/usr/local' '--with-mnogosearch=/usr/local/mnogosearch'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-12 04:41 UTC] yohgaki@php.net
4.1.0 does not have problem. Please reopen if you still have the same problem.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Feb 25 09:01:24 2020 UTC