PHP Session Support in /tmp

Kevin Kinsey kdk at daleco.biz
Sun Nov 23 19:07:02 PST 2008


Ivan Voras wrote:
> APseudoUtopia wrote:
>> Hey.
>>
>> PHP stores session data for the 'file' handler in /tmp, by default.
>> For organizational purposes, I'd like to change this to something like
>> /tmp/php_sessions/ or so. However, I have the clear_tmp_enable feature
>> enabled, so /tmp is cleared on reboot. PHP wont create the
>> php_sessions dir on it's own.
>>
>> So basically, I'm looking for a way to create the dir
>> /tmp/php_sessions/ each time the server is booted BEFORE apache
>> starts. I'm sure I could do this somehow with the rc.d scripts, but I
>> really have no idea how.
> 
> man 8 rc.local
> 
And, by way of an alternate suggestion, remember that cron(8)
recognizes an "@reboot" special string instead of the normal
five-field time indicators.

@reboot		/bin/mkdir /tmp/php_sessions

HTH,

Kevin Kinsey

-- 
It's amazing how many people you could be friends
with if only they'd make the first approach.



More information about the freebsd-questions mailing list