php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21250 echo output is blocked when using system(), exec(), backticks, etc.
Submitted: 2002-12-28 11:19 UTC Modified: 2002-12-29 04:39 UTC
From: adam at ripcord dot net Assigned:
Status: Closed Package: Output Control
PHP Version: 4.3.0 OS: OpenBSD 3.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: adam at ripcord dot net
New email:
PHP Version: OS:

 

 [2002-12-28 11:19 UTC] adam at ripcord dot net
A script that I have which automates the building of Apache + PHP + ModSSL is showing strange behavior with PHP 4.3.0.

This script works fine with 4.2.x (CGI), but as soon as I upgraded to 4.3.0 (CLI), all output from echo is blocked until the commands that I run through my many calls to system() are complete. The new CLI docs say that implicit flush is on by default with the CLI, but when using system(), exec(), or backticks this doesn't seem to be the case.

My apologies if this is mere user stupidity.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-28 11:21 UTC] iliaa@php.net
Check your php.ini, you probably have output buffering enabled.
 [2002-12-28 12:00 UTC] adam at ripcord dot net
Thanks for pointing that out, though it wasn't the problem.

The CLI documentation leads one to believe that, by default, the PHP CLI binary will override implicit_flush in the php.ini. This does not seem to be the case. Making a new copy of php.ini in a different directory and setting implicit_flush=On (along with output_buffering=Off for good measure) did the trick.

Bug? Incorrect documentation? Even more user stupidity? :)
 [2002-12-29 04:39 UTC] edink@php.net
imlicit_flush and output_buffering are two unrelated things, but this fact has been known to confuse even seasoned php developers :)

In 4.3.0 you can have php-cli.ini (or php-{sapi}.ini) which can help configure different sapi's in different ways.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC