Home > php教程 > php手册 > Warning: session_start() [function.session-start]

Warning: session_start() [function.session-start]

WBOY
Release: 2016-06-13 09:57:04
Original
1173 people have browsed it

可以使用session的朋友有经常会碰到Warning: session_start() [function.session-start]错误提示了,这个问题其实就是在session之前有数据输入了,解决办法很简单下面我来给大家总结。

我的电脑中的错误提示

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:APMServ-v5.2.6APMServ5.2.6wwwhtdocsKingNerOAuserUserKqManage.php:1) in D:APMServ-v5.2.6APMServ5.2.6wwwhtdocsKingNerOAusercheckaccess.php on line 2

原因就是前面有输出

解决办法:

修改php.ini中的session.auto_start = 0 为 session.auto_start = 1
output_buffering =改为on或者任何数字。

linux中解决办法

解决办法:

方法1、注释掉/etc/php.ini中
session.save_path = “/var/lib/php/session”
方法2、查看apache用户和组,然后将该用户加到session文件夹所处的组中。
方法3,在session_start() 前不要有任何输出!


错误提示2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:phpcodeadmin.php:1) in E:phpcodelogolistadminlogo.php on line 2

就是 session变量需要系统的临时空间

session.save_path = "设置一个有效文件夹的绝对路径"

(比如 session.save_path = "C:WINDOWStemp" )

session.save_path =前面的 ' ; '  号去掉

另外编辑该文件夹的权限 添加EVERYONE 有写入修改权限即可 !

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template