我在下面的代码中执行“echo ...”的那 2 行出现无法解释的“标头已在 #... 行发送”错误。
案例的简化版:
<?php
ob_start();
//Initializing FirePHP...
include_once(F_FS_PATH."lib/FirePHPCore/fb.php");
// <--- I've also tried to move the ob_start(), after the FirePHP init,
// <--- instead before it. But it made no difference.
?>
<html>
<div>A lots of HTML (and php) code goes here... Actually my entire page.
FirePHP is also used here many times by multiple invocations
of the function fb('debug text');</div>
</html>
<?php
$all_page_content=ob_get_clean();
if ($GLOBALS["marketing_enabled"])
echo marketingReplaceContent($all_page_content);
else
echo $all_page_content;
ob_flush(); flush();
//Do some other non-printing - but slow stuff.
do_the_silent_slow_stuff_Now();
// <--- presumably the php execution ends here.
?>
我不明白为什么在我打印缓冲区并刷新它之后,FirePHP 会在页面完成后尝试做某事?或者它在尝试什么?我该如何应对这个问题?:(