PHP's ob_flush() causing error

philfreo picture philfreo · Jul 14, 2010 · Viewed 8.1k times · Source

When I call PHP's ob_flush() function on my localhost (via MAMP) I get the following error:

Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush.

The only solution I can find is to prefix it with @, but this doesn't seem like a real solution to me. What's causing the problem?

Answer

Kalium picture Kalium · Jul 14, 2010

The error message would seem to imply that you're not actually using output buffering when you call ob_flush(). Have you called ob_start() previous to invoking ob_flush()?