我的PHP代码出错(无法发送cookie缓存、会话缓存限制)

我的PHP代码出错(无法发送cookie缓存、会话缓存限制),php,session,caching,cookies,xampp,Php,Session,Caching,Cookies,Xampp,我正在尝试创建一个注册和登录页面。尝试将代码上载到服务器时,会产生两个错误: 警告:session_start()[function.session start]:无法发送会话cookie-已由第2行的/Applications/XAMPP/xamppfiles/htdocs/tisun_search/index.php中的/Applications/XAMPP/xampfiles/htdocs/tisun_search/functions.php中的/Applications/XAMPP/XA

我正在尝试创建一个注册和登录页面。尝试将代码上载到服务器时,会产生两个错误:

警告:session_start()[function.session start]:无法发送会话cookie-已由第2行的/Applications/XAMPP/xamppfiles/htdocs/tisun_search/index.php中的/Applications/XAMPP/xampfiles/htdocs/tisun_search/functions.php中的/Applications/XAMPP/XAMPP/XAMPP/xamppfiles/XAMPP/xamppfiles/tisun_

警告:session_start()[function.session start]:无法发送会话缓存限制器-第2行的/Applications/XAMPP/xamppfiles/htdocs/tisun_search/index.php:52中已发送的头(输出从/Applications/XAMPP/xampfiles/htdocs/tisun_search/functions.php开始)

我在functions.php文件中检查了这个问题,没有空格,也没有任何可见的错误

我想知道是否有人会碰巧知道这个错误发生的任何其他原因,以及修复这个错误的解决方案

下面是my functions.php代码的开头(没有php标记)


下面的代码显示了错误发生的位置

解决此问题的唯一方法是遍历所有包含,并检查它们是否正在执行某些输出(echo、printf),或者最常见的是,在纯包含(类等)中,在最终关闭后是否有空格和NL?>:

....
} // end of class xyz

/*
 * some comments
 */
············¶
?>·················¶
¶
¶
¶
¶
<--- EOF
。。。。
}//类xyz的结尾
/*
*一些评论
*/
············¶
?>·················¶
¶
¶
¶
¶

嗯。错误消息告诉您输出发生的确切位置
(输出开始于/Applications/XAMPP/xamppfiles/htdocs/tisun_search/index.php:52)
(即文件/Applications/XAMPP/xamppfiles/htdocs/tisun_search/index.php的第52行)问题实际上是关于会话开始的时间,它应该在被调用脚本的最开始,而不是在脚本执行过程中的一个包含文件中
....
} // end of class xyz

/*
 * some comments
 */
············¶
?>·················¶
¶
¶
¶
¶
<--- EOF