Bug #13430: Passthru doesn't honor ob_immediate_flush

From: Date: Tue, 25 Sep 2001 12:09:45 +0000
Subject: Bug #13430: Passthru doesn't honor ob_immediate_flush
Groups: php.dev 
Request: Send a blank email to php-dev+get-66535@lists.php.net to get a copy of this message
From: muell@delirium.ch Operating system: RedHat 7.1 PHP version: 4.0.4pl1 PHP Bug Type: Output Control Bug description: Passthru doesn't honor ob_immediate_flush Given a perl script test.pl: #!/usr/bin/perl $| = 1; # immediate flush for ($i=0;$i<10;$i++) { print "*"; sleep(2); } exit; And a php script test.php: <? header("Content-Type: text/plain"); ob_immediate_flush; # here or in php.ini echo "calling test.pl\n"; passthru("/path/to/test.pl"); echo "finished\n"; ?> Eventhough both scripts have buffering disabled, no progressive content loading happens. PHP autoflushes the first echo-line, but passthru-output is not flushed until the test.pl script has completed. There are situations where this behavior is no good. I have perl-scripts doing jobs on our server. These perl-scripts are called from a webpage (aka php-script). However, an inbetween firewall shuts down communication after 5 mins with no data transferred. In order to keep the connection alive, I rewrote the perl-scripts such as to send a progress character to the browser every 30 seconds. Not being autoflushed, they don't keep alive anything :-) -- Edit bug report at: http://bugs.php.net/?id=13430&edit=1

« previous php.dev (#66535) next »