Click to See Complete Forum and Search --> : flush() not woking on Linux+Apache?


dspillett
09-28-2002, 09:16 PM
I'm playing with some code that performs a few heavy DB queries, and uses calls to the flush() function in order to give the user some basic progress information.

This works fine on my paid-for web hosts configuration, butnot on any of my home setups. I don't expect it to work on Win32 as the manual states that is won't, but the flush() command doesn't seem to have any effect on my Linux/Apache/php setup either.

One of the user notes on the manual page for flush() (http://www.php.net/flush) is to call ob_flush() as well - but if I try that PHP reports that the ob_flush doesn't exist... [though it doesn't complain about ob_start].

FYI: the versions I have installed are:
Apache 1.3.26
PHP 4.1.2
Over-all the machine is a fairly basic/standard Debian Woddy [kernel 2.2.20] setup.

Are there any settings that I have missed that enable/change the output buffering behaviour?

dspillett
09-28-2002, 09:25 PM
Oh, and ob_implicit_flush doesn't seem to have the desired effect either...

dotwebbie
09-30-2002, 11:51 AM
Is flush() not enabled on your home system? Which version of php? Is it the same version as your host?

dspillett
10-03-2002, 07:33 PM
flush() is working as expected on my webhost (RedHat some-thing-or-other, PHP4.1.2) but not on my home test box (fairly normal Debian setup with relevant security patches, PHP4.1.2).

As far as I can tell there is nothing more I need to do in order to get flush() to work on my test box.

Its not really a problem anymore though: I've rewritten the scripts so that they don't need to use flush() - this way I can make use of mod_gzip.

jasongonella
10-14-2002, 12:02 PM
Set output buffering to off in the php.ini file - this'll do it. You can keep implicit_flush off as well.

Jason