An error occurred while enabling OB cache? . What should I do?

Source: Internet
Author: User
Enabling OB cache is invalid ??? . In this case, the ob of php. ini is disabled. I directly run the following code to prompt an error: & lt ;? Phpecho & nbsp; "OK"; header ("content-type: text/html; charset = utf-8"); echo & nbsp; "ook ";? & Gt; output later: enabling OB cache in okWarn is invalid ??? .
In this case, the ob of php. ini is disabled. I directly run the following code to prompt an error:
 echo "ok";
header("content-type:text/html;charset=utf-8");
echo "ook";
?>

Output later:
ok
Warning: 
Cannot modify header information - headers already sent by (output started at C:\php\apache\htdocs\static\test.php:1) in C:\php\apache\htdocs\static\test.php on line 4
ook


With ob_start () enabled ob cache, there should be no error. I add ob, the code is as follows:
 ob_start(); 
echo "ok";
header("content-type:text/html;charset=utf-8");
echo "ook";
?>


Running result:
ok
Warning: Cannot modify header information - headers already sent by (output started at C:\php\apache\htdocs\static\test.php:1) in C:\php\apache\htdocs\static\test.php on line 4
ook
Share:
------ Solution --------------------
Remove the BOM header and try again.
------ Solution --------------------
The BOM header is available only because it is created using the "notepad ".
If you save it as ANSI, there will be no BOM header. you can try it out (of course it is not UTF-8 encoded)

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.