This is a nice way to show real time output of your shell commands:
// tell php to automatically flush after every output
// including lines of output produced by shell commands
$command = 'rsync -avz /your/directory1 /your/directory2';
It doesn’t work on every server I have tried it on though, I wish I could offer advice on what to look for in your php configuration to determine whether or not you should pull your hair out trying to get this type of behavior to work on your server! Anyone else know?
Here’s a dummy example in plain PHP:
echo $i . "\n";
I hope this helps others who have googled their way here.