session_start();报错有关问题
程序员文章站
2022-04-26 22:10:00
...
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头。
相关文章
相关视频
上一篇: NGINX配置rtmp服务器实现rtmp以及hls直播
下一篇: css中的三种定位机制
推荐阅读
-
解决php用mysql方式连接数据库出现Deprecated报错问题
-
SQLServer中bigint转int带符号时报错问题解决方法
-
解决vue 项目引入字体图标报错、不显示等问题
-
appium运行各种坑爹报错问题及解决方法【推荐】
-
详解打开网页js报错问题的多种解决方法
-
详解Androidstudio3.0 关于Gradle报错的问题(小结)
-
有关wxpython pyqt内存占用问题分析
-
Python安装Imaging报错:The _imaging C module is not installed问题解决方法
-
浅谈mysql密码遗忘和登陆报错的问题
-
有关HTML5 Video对象的ontimeupdate事件(Chrome上无效)的问题