Summary | "Headers already sent" caused by usage of flush() |
Queue | DIMP |
Queue Version | 1.1.1 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | jan (at) horde (dot) org |
Requester | thomas (at) gelf (dot) net |
Created | 01/15/2009 (6012 days ago) |
Due | |
Updated | 08/07/2010 (5443 days ago) |
Assigned | 01/15/2009 (6012 days ago) |
Resolved | 08/07/2010 (5443 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Fix notices with certain output buffer configurations
(Valentin.Vidic@CARNet.hr,
Bug #7851).http://git.horde.org/diff.php/imp/docs/CHANGES?rt=horde-git&r1=19c0155646f0ccddf91d0f33e237b035d401f075&r2=73d6cbe80185537f3845952d00e351a4a1b26b03
http://git.horde.org/diff.php/imp/lib/Dimp.php?rt=horde-git&r1=76c1c091e8c027ce77dea8d76ceb2fef5d4cecb4&r2=73d6cbe80185537f3845952d00e351a4a1b26b03
http://git.horde.org/diff.php/kronolith/lib/Kronolith.php?rt=horde-git&r1=2d61ecac5bcd544a6ea4e9c0cc1200f6e6b2d283&r2=73d6cbe80185537f3845952d00e351a4a1b26b03
State ⇒ Resolved
Fix notices with certain output buffer configurations
(Valentin.Vidic@CARNet.hr,
Bug #7851).http://cvs.horde.org/diff.php/dimp/docs/CHANGES?rt=horde&r1=1.69.2.84&r2=1.69.2.85&ty=u
http://cvs.horde.org/diff.php/dimp/lib/DIMP.php?rt=horde&r1=1.110.2.39&r2=1.110.2.40&ty=u
New Attachment: dimp_flush.diff
in apache error logs. However the manual for flush says:
http://php.net/manual/en/function.flush.php
flush() may not be able to override the buffering scheme of your web
server and it has no effect on any client-side buffering in the
browser. It also doesn't affect PHP's userspace output buffering
mechanism. This means you will have to call both ob_flush() and
flush() to flush the ob output buffers if you are using those.
And if I add an ob_flush() call before flush() the error message goes
away. Patch is attached.
files or the beginning of the translations (?) might be the thing to
try next here.
http://trac.roundcube.net/ticket/1483926
and helped me to easily "solve" my problem. But I still have no idea
how UTF8 BOM's could cause this issue?! If so, this must be a PHP bug,
is this assumption correct? Shall I search for UTF8-Strings in my config
files??
I still have no clue :-( Thank you for your patience!!
on line 0
config files.
number where the output started. And even without the flush notices
would still be there.
Anyway, it might be this similar issue (w/UTF8 BOM's):
http://trac.roundcube.net/ticket/1483926
on line 0
config files.
number where the output started. And even without the flush notices
would still be there.
end of processing and toss it - but will also this unexpected output
at a DEBUG level to the Horde log. So this has probably been an
issue forever - you simply haven't seen it because you are not
logging at a DEBUG level.
production since four days right now) there have been thousands of
this strange line in my syslog, I'm logging all PHP errors and warnings.
In our beta phase I've had PHP output Notices to the browser, but I
never noticed them, and I still have no idea, WHY they appear. It
could also be related to some strange PHP bug. But fact is: removing
the flush solved it, no more such notice so far.
As soon as time allows me to do so, I'll try to do some more tests.
If someone else running DIMP in a production environment with more
than a few hundred users, preferrably with same / similar PHP version
and APC enabled, could enable logging for PHP errors and tell me
wheter he / she is also seeing this errors, that would be a great help.
For sure it could also be related to our personalisation / customization
work, we strongly modified DIMP's appearance - but (repeating myself)
if I really would have some prior output in my code or config files, PHP
would tell me WHERE output has started.
This one is really strange, I've neve before seen something similar.
Anyone else?
State ⇒ Feedback
and 1.132 - causing thousands of warning lines a day in my syslog:
config files.
Apache Module, APC Cache enabled.
See http://cvs.horde.org/diff.php/dimp/lib/DIMP.php?r1=1.131&r2=1.132
for the exact change (not documented in CVS log).
Removing the flush()-call solves this issue, no more warnings since then.
of processing and toss it - but will also this unexpected output at a
DEBUG level to the Horde log. So this has probably been an issue
forever - you simply haven't seen it because you are not logging at a
DEBUG level.
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ DIMP
Summary ⇒ "Headers already sent" caused by usage of flush()
Type ⇒ Bug
Priority ⇒ 2. Medium
and 1.132 - causing thousands of warning lines a day in my syslog:
Apache Module, APC Cache enabled.
See http://cvs.horde.org/diff.php/dimp/lib/DIMP.php?r1=1.131&r2=1.132
for the exact change (not documented in CVS log).
Removing the flush()-call solves this issue, no more warnings since then.
Kind regards,
Thomas Gelf