Search code examples
phpapachesessionmemcachedorientdb

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


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!


Solution

  • 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.