Php problem: Warning: Cannotmodifyheaderinformation

Source: Internet
Author: User
When I was writing php code, I suddenly encountered a problem: Warning: Cannotmodifyheaderinformation

When I was writing php code, I suddenly encountered a problem: the prompt Warning: Cannot modify header information-headers already sent..., there are a lot of messy things on the page. It's strange that at the beginning, this problem sometimes disappears. It was strange that many php configuration changes were found in the web query later,

When writing php code, I suddenly encountered a problem:

Prompt Warning: Cannot modify header information-headers already sent ...,

There are a lot of messy things on the page. It's strange that this problem sometimes disappears at the beginning. Very strange

I found a lot of php configuration changes on the Internet later, and I felt that there was a sudden problem with the good page, which is not a problem with the php configuration. It shows where the code encountered a problem,

I recalled the newly added code. There were only a few methods to call system () to execute the command line. Then I checked the system function and found the problem: the system () function executes the given command, output and return results. Therefore, when executing the command line command, the output information is output to the page, and an exec command is found during the query, which is similar to system, but it executes the command and does not output the result, only the last row of the result is returned. So use exec to replace system, so that no output is available, and the problem is solved!

As for the problem, sometimes the output cache may disappear due to command line output.

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.