|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23926 CLI buffers when it's not supposed to.
Submitted: 2003-05-31 13:35 UTC Modified: 2003-05-31 20:41 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jkitching at mailbolt dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.2 OS: Linux plebb 2.4.20 #15 Sat May 1
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.
Block user comment
Status: Assign to:
Bug Type:
From: jkitching at mailbolt dot com
New email:
PHP Version: OS:


 [2003-05-31 13:35 UTC] jkitching at mailbolt dot com
At it says this:

" There are certain php.ini directives which are overriden by the CLI SAPI because they do not make sense in shell environments: "

Then it lists the overriden php.ini directives, which includes inplicit_flush, defaulting it to true.

So theoretically, CLI shouldn't buffer.  This is true with the RC releases of 4.3.2, but with the final release, it BUFFERS!
And I mean it really buffers.  I tried flush() and ob_implicit_flush();, but it still only outputs at the end of the script.  Here is a sample script:

echo 'This should be printed immediately.';

When executing this script at the command line, it outputs "This should be printed immediately." after a wait of 5 seconds.  This tells us that it is buffering.

I hope someone would email me if this program acts differently on their computer, or if the bug is fixed.  My email is


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-31 20:41 UTC]
CLI will honour output buffering directive from php.ini (this is a different issue from implicit_flush). Either remove that ini entry or run CLI with -n (ignore ini file) option. 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 04:05:45 2022 UTC