It used to be easy to find solutions of my problem when Google gives many accurate results that point to Stackoverflow. But, I didn\'t found one for this problem. If any of
You can output javascript from your long running script:
while(doThings()) {
echo '
<script> updateProgress("' . $x .'%");</script>';
flush();
}
I personaly use bootstrap: http://getbootstrap.com/components/#progress
Explaining Step2
step 2 is generally based on your application flow, lets say for example i'm inserting 100,000 records in MYSQL, i would create another service that will check the rows count and the result were 30,000 records for example, that means the progress now is 30%, so if i call this service every 10 seconds i would get the current progress.