PHP技术,网站开发,PHP,PHP学习,Python学习,PHP开发,人工智能,大数据服务

PHP » 编程开发 » php Notice: A session had already been starte解决办法

php Notice: A session had already been starte解决办法

此文被围观2770日期: 2014-08-11 分类 : 编程开发  标签:  ··

php,php notice,php Notice: A session had already been starte解决办法 

Notice: A session had already been started – ignoring session_start() in .. on line ..

This happens when you try to start session more than once.

The solution for above problem is

1) in php.ini file set session.autostart to 0

session.auto_start = 0

2) In your code use this line

if (!session_id()) session_start();

代替

session_start();


© Copyright 2011-2019 adophper.com. All Rights Reserved.
读图网科技 版权所有。蜀ICP备12031064号