session_start();报错有关问题
程序员文章站
2022-04-11 20:45:07
...
session_start();报错问题
test.php文件内容
include('site_test.php');
?>
site_test.php文件内容
session_start();
header('Content-Type: text/html; charset=utf-8');
?>
当打开test.php时报以下错误,弄了很久也弄不明白,不知为什么?
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/cybertry/public_html/idearforyou.com/site_test.php:1) in /home/cybertry/public_html/idearforyou.com/site_test.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/cybertry/public_html/idearforyou.com/site_test.php:1) in /home/cybertry/public_html/idearforyou.com/site_test.php on line 3
------解决方案--------------------
session_start();前面不能有输出
------解决方案--------------------
site_test.php 是什么编码,如果是utf-8编码,确认没有bom头。
test.php文件内容
include('site_test.php');
?>
site_test.php文件内容
session_start();
header('Content-Type: text/html; charset=utf-8');
?>
当打开test.php时报以下错误,弄了很久也弄不明白,不知为什么?
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/cybertry/public_html/idearforyou.com/site_test.php:1) in /home/cybertry/public_html/idearforyou.com/site_test.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/cybertry/public_html/idearforyou.com/site_test.php:1) in /home/cybertry/public_html/idearforyou.com/site_test.php on line 3
------解决方案--------------------
session_start();前面不能有输出
------解决方案--------------------
site_test.php 是什么编码,如果是utf-8编码,确认没有bom头。
相关文章
相关视频
下一篇: PHP单例模式详细介绍_php实例
推荐阅读
-
解决Unixbench安装报错信息的问题
-
使用cmd运行mysql数据库的时候,报错:"不是内部命令也不是可有运行的程序"问题的解决办法
-
WEB网站发布服务器IIS报错问题终极解决方案,查到问题点
-
JSONArray.fromObject不执行且不报错问题的解决
-
解决cannot be cast to javax.servlet.Filter 报错的问题
-
Fatal error: session_start(): Failed to initialize storage module: files问题解决方法
-
安装 VS2005 SP1 有关问题的解决办法
-
关于导入maven项目时pom.xml报错问题
-
Asp.Net中Global报错,关键字也不变色问题
-
IE8下Jquery获取select选中的值post到后台报错问题