PHP Warning: A session is active. You cannot change the session module's ini settings at this time in /../

£可爱£侵袭症+ 提交于 2019-12-24 13:33:09

问题


I created my custom PHP session handler and sometimes I get the PHP warning:

PHP Warning:  curl_exec(): A session is active. You cannot change the session module's ini settings at this time in

This appear to be a randomic issue, and "curl_exe()" function is not the problem, since the function always changes when the error occures.

The custom session handler saves sessions into memcache and OrientDB, I am sure memcache and orientdb don't have problems when the error occures because I have no errors retrieving/saving data on them before and after the warning.

I'm using Debian 6.0.6 stable, with 2.2.16-6+squeeze10 (prefork) and libapache2-mod-php5 5.3.3-7+squeeze14. I think it's a PHP bug, but I'm not finding it into the php or debian bug database. Any glue? Thanks.

P.S. If you need the session handler PHP code, I can publish it open source!


回答1:


I've found the source of the problem. If you are using apache prefork with PHP but you are using one apache module that make use of threads (in my case mod_spdy by google) you may have problems with PHP.

Commenting out mod_spdy (or in your case any other module using threads) in httpd.conf seems to completely solve the problem.



来源:https://stackoverflow.com/questions/13654848/php-warning-a-session-is-active-you-cannot-change-the-session-modules-ini-set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!