php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18793 PHP won't display output until script has finished executing.
Submitted: 2002-08-07 15:26 UTC Modified: 2002-08-07 15:29 UTC
From: davidt at jelly dot eng dot wayne dot edu Assigned:
Status: Closed Package: Output Control
PHP Version: 4.2.2 OS: FreeBSD 4.6
Private report: No CVE-ID: None
 [2002-08-07 15:26 UTC] davidt at jelly dot eng dot wayne dot edu
I am writing a script (from the command prompt) that runs for a very long time.  I need the script to return progress reports (echos) in the middle of the script.  This used to work in PHP 4.2.1 but now that I've upgraded to PHP 4.2.2, this is no longer working.  Now, the script only returns the output after completing.  The code I used is:

<?
echo "Displaying Output\n";
flush();
sleep(5);
?>

In this example, the echo is displayed on my screen only after the script has completed (5 seconds after it was issued).  However, It shows immediately in 4.2.1.
 
I've also tried it without the flush() function and it has the same result.  

Any help would be much appreciated.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-07 15:29 UTC] kalowsky@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC