Does anyone know a way to monitor PHP code processing and display on the client?
I'm designing a layout converter that takes data files in a certain format and converts them to another format.
Basically, I would like to present to the user (in the client browser) a progress bar with the evolution of the processing of the files on the server. This processing is not the progress of upload (this is done with XMLHTTPRequest
), but the progress of the conversion.
I've tried setting up a cookie with setcookie
and setrawcookie
in PHP every 10% processed and trying to get the cookie value with Javascript on the client, also every 1 second with setInterval()
, but it seems that PHP sends all cookies at once after processing script , not at the moment setcookie()
is called.
I've also tried to use header()
instead of setcookie
and also the sent header only appear on the client after full script processing.
The beginning of the processing on the server I have done with XMLHTTPRequest
for the page that does the processing.
I also tried with iframe, causing the rendering to run in the iframe and trying to get its cookies from the main page, but I was not successful. I was able to monitor using a text file where php writes progress and read it through Ajax. However, it only seems to work with php safe thred