Use Ob_flush tip: E_warning:cannot Modify header information

Source: Internet
Author: User
Use Ob_flush tip: E_warning:cannot Modify header Information-headers already sent
How can I resolve this?

The code is as follows:
echo $show _msg. "";
Ob_flush ();
Flush ();


Reply to discussion (solution)

BOM Head bar.

The error message has been written clearly, the response header has been output, so you can no longer modify the header information

Should be you do not open a new layer of OB, directly output the data (at the same time output the response header), the default is directly sent to the browser

Using OB normally is the first to write the data in the OB, and then output the content of the OB when it is finished.

The error message has been written clearly, the response header has been output, so you can no longer modify the header information

Should be you do not open a new layer of OB, directly output the data (at the same time output the response header), the default is directly sent to the browser

Using OB normally is the first to write the data in the OB, and then output the content of the OB when it is finished.

Simply put, you might not be using Ob_start.

function Flush_buffers () {     ob_end_flush ();     Ob_flush ();     Flush ();     


The error message has been written clearly, the response header has been output, so you can no longer modify the header information

Should be you do not open a new layer of OB, directly output the data (at the same time output the response header), the default is directly sent to the browser

Using OB normally is the first to write the data in the OB, and then output the content of the OB when it is finished.

Simply put, you might not be using Ob_start.

How to use it specifically? I developed it on the Phpwind. He was in front of an insert operation, do not understand why get an output, I searched the code also did not find where there is output. In short, I was unable to change his output of the fact that I could not change his code. I was behind him using flush. Is there any way to fix it?

function Flush_buffers () {     ob_end_flush ();     Ob_flush ();     Flush ();     


Use, or make a mistake.

I developed it on the Phpwind. He was in front of an insert operation, do not understand why get an output, I searched the code also did not find where there is output. In short, I was unable to change his output of the fact that I could not change his code. I was behind him using flush. Is there any way to fix it?

BOM Head bar.
There should be an output in the front. Is there any function that can ignore the previous output? It seems to remember that there is. Ob_end_flush, Ob_flush, flush, Ob_start I'm so confused.

Ob_flush (); is to roll out the cache, it's impossible to say the question
Only headers, Session_Start, Setcookie can appear
E_warning:cannot Modify header Information-headers already sent

Please take a good look at the error message that is prompted by the wrong place

Ob_flush (); is to roll out the cache, it's impossible to say the question
Only headers, Session_Start, Setcookie can appear
E_warning:cannot Modify header Information-headers already sent

Please take a good look at the error message that is prompted by the wrong place

What you say is reasonable, if the front because the output caused an error, I have already reported the output of the error. But the error is really ob_flush this line.
I doubt if there is a ob_start (' Ob_gzhandler ') in front of me; these are similar codes.

Ob_flush (); is to roll out the cache, it's impossible to say the question
Only headers, Session_Start, Setcookie can appear
E_warning:cannot Modify header Information-headers already sent

Please take a good look at the error message that is prompted by the wrong place

If you were to


This code is preceded by a line of what code makes him go wrong. What code would you add?

Unless there is a syntax error, there is nothing wrong with #10 code!
But in the back of the header, Session_Start, Setcookie One, it could be wrong

You'd better put out the complete error message.

Unless there is a syntax error, there is nothing wrong with #10 code!
But in the back of the header, Session_Start, Setcookie One, it could be wrong

You'd better put out the complete error message.

I have found the answer to the question. It was my line of code that blocked the system's error, not the system that affected my line of code. The error message is as follows:

Uncaught error with message ' E_warning:cannot Modify header information-headers already sent by (output started at e:\a ppserv\www\phpwind\upload\src\extensions\pwpick\service\srv\helper\adminoutputhelper.php:323) ' The server Encountered an internal error and failed to process your request. Please try again later. If This error is temporary, reloading the page might resolve the problem. If you is able to contact the administrator, this error message. (http://www.windframework.com/)


This error message is Phpwind himself, he has a function to do this.

/** * ERROR View rendering *  * @param array $__vars */private function render ($__vars, $errorcode, $errDir, $errPage) {@extract ($__v ARS, Extr_refs); unset ($__vars); Ob_start (); $this->getresponse ()->setstatus ($errorcode); $this GetResponse ()->sendheaders (); Require $errDir. '/' . $errPage. '. htm '; exit ();}


See $this->getresponse ()->sendheaders (); Is this all right? I had the output in front of me, and he made the mistake of doing it again. I was misled by his error in Ob_flush ();

Thank you for your attention.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.