ID:               20015
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Won\'t fix
 Bug Type:         Output Control
 Operating System: Linux Redhat 7.2
 PHP Version:      4.2.3
 New Comment:

Your output is buffered since there is "trans sid" buffer due to
sessoin_auto_start=1. It prevents output buffer flushing.

BTW, there is flush function called ob_flush(). It differs from
flush(). However, ob_flush() is also broken from the beginning and it
will _not_ be fixed. So don't use it.

Don't try to use ob_implicit_flush() to flush output buffer, it does
not flush output buffer, but SAPI buffer. It will _not_ help to output
buffer flushing at all.

flush() try to flush web server buffer and it does not help flushing
output buffer contents at all.

If need to direct output, don't use buffers. i.e. don't use trans sid,
char encoding tranlation, zlib output compression, ob_gzhandler
compression, etc, etc.




Previous Comments:
------------------------------------------------------------------------

[2002-10-22 11:03:39] [EMAIL PROTECTED]

So this is indeed a bug ? Great.

In the meanwhile, for anyone else who is expiriencing the same problem
I recommand the solution I found for myself, until more light is shed
on this issue. When you configure before the compilation, use the
--with-config-file-path=[path] switch, and compile the apache module
with let's say /etc/php/apxs/ and the cli binary with /etc/php/cli/.
That way you can tweak the configuration independently for each build,
and disable things for the cli without interfering with the web
server's work.

------------------------------------------------------------------------

[2002-10-22 03:43:58] [EMAIL PROTECTED]

Attempt that enables output buffers flushing is rejected, so it won't
fix.

------------------------------------------------------------------------

[2002-10-22 01:37:52] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip

------------------------------------------------------------------------

[2002-10-21 16:21:07] [EMAIL PROTECTED]

also setting "-d session.auto_start=0" in the binary command line in
the first line of the script doesn't solve the problem, yet doing so
when calling the script in the "php [script name]" form from the shell
does. in both cases setting the entry in the ini file solves the
problem completely.

------------------------------------------------------------------------

[2002-10-21 16:13:23] [EMAIL PROTECTED]

I'm not sure this is indeed a bug, I tried looking for some piece of
documentation about this, but failed.

I wrote a script that used the flush() command and it failed to operate
correctly. knowing the many possible pitfalls around output buffering,
and since the role of the script is a web-crawler anyway, I moved it to
the cli version, yet the problem persisted - the script (which is meant
to work for hours) refuses to flush it's output, no matter what I did.


After going over the ini file line by line commenting and uncommenting,
I found that "session.auto_start = 1" causes php to fail any form of
output buffer flushing: flush(), ob_flush() and implicit_flush
directive, even with the cli sapi.

I don't want to duplicate the ini file, therefore I would be happy to
find a way to keep the apache module with session.auto_start=1, yet
overcoming this issue, so to be able to flush my output, at least in
cli scripts.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20015&edit=1

Reply via email to