Notice: A session had already been started错误

发布:2013-09-18 12:59   点击747次   评论:0

Notice: A session had already been started – ignoring session_start()...
出现以下错误的解决办法:
Notice: A session had already been started – ignoring session_start() in .. on line ..
之所以出现这种情况是页面中多次使用了 session_start()函数

有以下两种解决办法:
1) in php.ini file set session.autostart to 0 配置php.ini 设置session.autostart =0
session.auto_start = 0

2) In your code use this line 在出现错误的页面中编辑你的代码如下:
if (!session_id()) session_start();
instead of
session_start();

关于 GitHub 导航 部门 反馈

提示:`/home.php`入口数据仅为演示功能,不构成任何交易凭证,也不承担相关风险和责任!

Copyright © 2011-2018 xxxxx.com All rights reserved.

Run:2.275/26.905(ms); 7(sql)/2.876(MB); comm:news/detail; Upd:2025-01-11 05:12:52