NYCPHP Meetup

NYPHP.org

[nycphp-talk] Output Buffering with CLI

federico ulfo rainelemental at gmail.com
Fri Jun 10 14:34:14 EDT 2011


On php.net somebody advised to flush the buffer with

    ob_end_flush();
    ob_flush();
    flush();
    ob_start();

You can try

On Jun 10, 2011, at 8:24 PM, Ronald Bradford <ronald.bradford at gmail.com>
wrote:

I am having an issue where I am not getting any output during a long running
CLI PHP script.

Before any output I do

  ob_start();
  ob_implicit_flush(true);

After each print I do

  ob_flush();


and at the end I do

  ob_end_flush();



However running my script I never get output as it happens.

e.g.

$ php example.php > file.log

I can confirm output is happening with

$ php example.php | tee -a  file.log

I can see output being generated, however it is not flushed to the output
file

Any help appreciated.

Regards

Ronald

_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20110610/f8628a17/attachment.html>


More information about the talk mailing list