Raoul Bhatia [IPAX] wrote:
> On 02/01/2011 02:05 PM, till wrote:
>> In addition to what Alec said -- sessions are usually taken care of
>> PHP itself. So e.g. you register a session handler and this is also
>> where "gc" is registered and then PHP executes this based on
>> session.gc_* settings in your php.ini.
>>
>> On some Linux distros (like Debian/Ubuntu) that part is particulary
>> broken as they disable PHP's garbage collector and assume sessions are
>> in /tmp and run a cronjob on it instead of using the build in gargabe
>> collector.
> 
> ah - this might be the issue then :) i'm running on debian and adapted
> my cronjobs to clean the correct session directory, as this is
> neither /tmp/ nor /var/lib/php5/.
> 
> 
> my php.ini shows:
>> zend.enable_gc => On => On
>> session.gc_divisor => 1000 => 1000
>> session.gc_maxlifetime => 1440 => 1440
>> session.gc_probability => 0 => 0
> 
> -> gc will runy with a probability of 0/1000 :)
> 
> what about rc using "ini_set('session.gc_probability', 1);"?
> 
> thanks,
> raoul

You just need to enable .htaccess overrides for your RC install as this is 
enabled in the RC root .htaccess file:

...
php_value       session.gc_maxlifetime  21600
php_value       session.gc_divisor      500
php_value       session.gc_probability  1
...

There is no need to mess about with the cron jobs etc. That may only break 
other PHP session stuff.

This is as documented in the Debian php.ini:
; This is disabled in the Debian packages, due to the strict permissions
; on /var/lib/php5.  Instead of setting this here, see the cronjob at
; /etc/cron.d/php5, which uses the session.gc_maxlifetime setting below.
; php scripts using their own session.save_path should make sure garbage
; collection is enabled by setting session.gc_probability

Chris
_______________________________________________
List info: http://lists.roundcube.net/dev/
BT/8f4f07cd

Reply via email to