|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-12-12 04:41 UTC] yohgaki@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 06:00:02 2025 UTC |
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'