I have an object for tasks and on __deconstruct (), it is designed to perform some longer cleaning tasks after the rest of the page is already loaded. Unfortunately, it buffers the output and does not send it until after the completion of tasks (nothing is printed in the tasks).
I read http://www.php.net/flush and tried all the suggestions there. Obviously, I tried disabling output_buffering in php.ini. I disabled deflate_module, zlib compression is off, does not have mod_gzip. Calling flush () or ob_flush () has no effect and does not allow implicit_flush.
I just run XAMPP (currently apache 2.2.17, php 5.3.4) under Windows Server 2008 R2. PHP runs as a module.
And yes, I could set up a little AJAX hack to launch the task manager or even set up a scheduled task to perform this specific task, but output buffering was also a problem elsewhere. It would be easy for it to go away sometimes.
From a similar topic, someone suggested looking at what the following would do:
<?php
while (TRUE)
{
echo 'x';
flush();
sleep(1);
}
?>
As expected, the page does not display anything until the maximum runtime is reached, at which point it will clear the buffer.
It became very unpleasant. Anyone have any ideas that can still trigger his buffering?
source
share