I'm coding a web application using SoX with the PHP exec() function.
Problem, SoX is a bit slow, and takes sometimes more than a minute to finish its task.
I'm trying to code a progress bar to let the user know that the web page has not crashed and SoX is still doing its job.
So far, I have a php page using the exec command and using callbacks. For each callback, I'm adding javascript code and call flush() to update the progress bar. So, it's the PHP updating the progress bar, meaning that the page is not ready until php is done with SoX.
Is this the best way to do this? I have seen some people using Ajax, loop and timers to manualy fetch data from PHP and update the progress bar. Is is more appropriate?
Thanks.
[EDIT] So after some comments, here is another question : If I start a php script, will the script keep going even if I Ajax to another page?