A release or two back the command flush(); became equiv. to null();. It's causing me a real problem as I have a web page that takes just over the timeout limit to run and kills the script (hosted site - TO not settable). When flush worked it would display each output line of the script and would run to the end, I could watch the progress and watch for abc1 OK, abc2 OK, abc3 FAIL, abc4 OK... I could take note and fix #3.

My hosting service upgraded from ??? 4.1 to 4.2 or something like that and flush/ob_flush just quit. The PHP manual pages - somewhat hidden in the man page is "it's broken and all the tweeking in the world won't fix it." (well something like that). I'm trying to find out "if" it will be fixed or not. You see I send out about 200 emails once a week "Your weekly local newspaper is available on line. Click here... yada yada....". Well, I wrote the code and the woman who does the paper likes to watch each email go by:aa11@msn.com .... OKabcde@foo4.net .... OKbob73@gmail.com .... FAILED
bobbi@xyz ... OK

And it worked great- until.... it didn't. I've tried a javascript in the php script - no output and the worst thing is the php script times out before all 200 emails are sent.

9
Lee
1 year ago
As of August 2012, all browsers seem to show an all-or-nothing approach to buffering. In other words, while php is operating, no content can be shown.
In particular this means that the following workarounds listed further down here are ineffective:
1) ob_flush (), flush () in any combination with other output buffering functions;
2) changes to php.ini involving setting output_buffer and/or zlib.output_compression to 0 or Off;
3) setting Apache variables such as "no-gzip" either through apache_setenv () or through entries in .htaccess.
So, until browsers begin to show buffered content again, the tips listed here are moot.

Now Lee seems to say it's the browsers fault - except that Chrome, Firefox and IE all stopped working on the same day. When I Google "php flush not working" I get pages of the same problem.

Veryyyyy interesting. I have 2 boxes 3.6.11-4.fc16.x86_64 and 2.6.35.14-106.fc14.i686 and on both boxes my script:

fc16 gives me a blank screen for 5 seconds then *bam* all 5 lines are there. On my fc14 box I get 1 line per second just the way it should work - both are running PHP 5.3.20 and this is from the same browser. Now I'm really confused'ed'ed'ed.....

Thanks
---------------------
Statistically, 6 out of 7 dwarves are not Happy.

Commented out flush on both boxes [fc16/fc14] - nothing shows up until the script is done, so flush() is needed/required.

I also copied my php.ini to my hosted site - htaccess - suPHP_ConfigPath /home/user/public_html - php.ini and it still doesn't work. I'm comparing phpinfo() - well trying - is not exactly a 1:1 match so the pain level is farily .... high... I'm starting to lean towards one of the libs, changed? missing? not loading?

John, FC16 is a Linux box, as is FC14, with no anti-virus SW. And I was able to get both of my Linux boxes to work just fine even outputing my data as a table - row... row... row... one every second.

I've been through the PHP man page for flush more times than I can count. I'm thinking that the entry "flush() may not be able to override the buffering scheme of your web server " is my problem and I won't be able to get it to work on that server. So I'm going to pack it in. Thanks for all of the advice. Me owe beer.