views:

31

answers:

3

I have a very large php maintenance script (basically it recreates thumbnails for an internal archive), it takes 10 to 20 minutes to complete and I noticed that php only displays "echos" when the whole script has finished parsing. Is there any way to show messages like:

Phase 1 - Complete
Phase 2 - Complete
Phase n - Complete

While the script is still doing his thing?

Thank you very much

+4  A: 

You probably want to flush the output.

Miguel Ventura
+1  A: 

Use flush() ( http://docs.php.net/flush ), but be aware that your web server may be buffering output. If so, you will have to turn it off or set the buffer very low to get output as it happens.

Scott Saunders
A: 

Or maybe turn of the output buffering in php.ini: output_buffering = Off

Ifju