我几乎肯定你确定在
PHP包含的末尾有一些尾随空格.先检查那里.
例:
// header file
include 'other_file.php';
?>/p>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
然后
// other_file.php
// connects to database, or something,
// but notice the whitespace after the closing tag
?>
... pretend this text isn't here
我在最后添加了注释以获得stackoverflow的降价编辑器以显示关闭后的其他行?>标签. PHP会在包含标记后自动截断一个换行符,但如果您有多个,则在doctype声明之前它们将被解释为空格.
最简单的修复?删除结束标记?>来自你的所有包括.这是a valid technique,可能是您启动和运行的最快方式.