I start my script from command line and it outputs things as they happen but a week ago it stopped outputing and now outputs everything when script finishes. I have ob_start() but as I know this does not effect command line output.
A:
It'd be very helpful if you could post your script here, at least the relevant parts, but things I'd test are:
- Did you turn on buffering?
- Are you running the process in something like a nohup or something else that may be buffering it?
- Did you change any other buffering settings?
Outputting only at the end of the script seems a buffering problem.
pavpanchekha
2009-12-11 17:22:21
A:
You need to remove ob_start()... try this code on the command line, and it will print the text all at once:
<?
ob_start();
echo "test\n";
sleep(10);
echo "buffer\n";
?>
r00fus
2009-12-11 18:43:32
I thought that ob_star() does not function in command line but it really does, this fixed the problem.
dfilkovi
2009-12-12 00:10:43