文件格式UTF8与BOM导致“标头已发送” - 错误

时间:2013-12-19 15:04:49

标签: php header

我收到此错误消息:

  

警告:无法修改标头信息 - 已在/Applications/MAMP/htdocs/---/functions.php中发送的标头(在/Applications/MAMP/htdocs/---/dbconnect.php:1处开始输出)第84行

这是dbconnect.php:

<?php if(!defined("INC")){
  define("INC", 1);
}
error_reporting(E_ALL);
require_once("config.mysqli.php");
@$mysqli = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname) or die("No Db found");?>

也尝试过:

<?php ob_start(null);
if(!defined("INC")){
  define("INC", 1);
}
error_reporting(E_ALL);
require_once("config.mysqli.php");
@$mysqli = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname) or die("No Db found");
ob_end_clean();?>

如果您需要更多信息,请与我们联系。谢谢!

1 个答案:

答案 0 :(得分:2)

看起来您可能有BOM错误。有关详情,请参阅此帖子:session_start() Error