Hi folks,
It's been a while since I messed with PHP (or really any server-side scripting), so I'm a bit stumped here.
I have a situation where Rackspace has some "load balancer" running that looks for no script>server>client activity and if none has been sent in 30 secs, it drops the http connection. I'm calling a script that executes an unzip which takes longer than 30 seconds, and my page call receives no reply as the connection gets dropped at 30 seconds. The unzip does complete server-side after a little longer than that.
Rackspace says if I have the script send back some data every 10 or 15 seconds, etc, that the connection will stay live and I'll see the result in the browser when the action is completed.
Can anyone suggest how to have PHP echo something to the browser like a status update every 10 secs during the process? Since PHP is not event-based, and doesn't seem to have any setInterval equivalent, I really have no idea how to get the script to echo anything at regular intervals until the task is complete.
I know to echo and then flush to see output to the browser, but it's the regular interval thing that is baffling me. Can't just set up a while loop with a conditional, right? Would cripple the CPU, right?