duanbi8089 2018-09-23 17:50 采纳率: 100%
浏览 120
已采纳

CodeIgniter版本3.x:加载“会话”库报告ini_set警告

I am using Codeigniter 3.0.1 in a Wamp64 installation (PHP Ver 5.6.19, Apache 2.4.18) on a Windows Server 2012 R2. When I have the line:

$autoload['libraries'] = array('session');

in autoload.php I get the following error on startup of my application:

ini_set() A session is active You cannot change the session module's ini settings at this time. Filename: libraries/Session.php Line Number: 313

If I take that line out of autoload.php and put the following line in the contructor function of the controllers that actually use the session data:

$this->load->library("Session")

I get the same error, but only when I start one of those controllers.

I have reviewed multiple answers to this question on stackoverflow:

  • Do you have a session_start() in your php code: NO - I have searched every piece of code included in this project and there is no session_start() anywhere
  • Do you have session.auto_start set equal to 0 (zero) in php.ini - YES

Neither of these answers solves my problem.

Session info is being written out to C:\temp on the server. I see the file is created when I start the controller that first loads the Session library so the web server seems to have write access to the C:\temp folder.

The other interesting thing is that I have no problem with the installation on my test server (Windows 7, php version 5.6.32)

Can anyone offer any suggestions? Thanks!

One more piece of information: This was an upgrade from 2.x to 3.0. I did delete the \system sub folder and replaced it with the V3 \system folder.

  • 写回答

1条回答 默认 最新

  • doubi9999 2018-10-01 14:26
    关注

    Found it.

    The issue was an Ajax library (Sijax) which external to Codeigniter instantiated an instance of the class so that the methods could be called via Ajax. The new(class) triggered loading the Session class again, which ran through the initialization and tried to create the session again.

    I removed the autoload of the Session class, and moved loading it to the Classes that require it, checking first to see if the Class already exists before calling the loader.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog