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)