FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » problem with session cleanup
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: problem with session cleanup [message #170140 is a reply to message #170138] Tue, 12 October 2010 12:40 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 10/12/2010 1:28 PM, bill wrote:
> On 10/12/2010 7:25 AM, bill wrote:
>> occasionally when I use an application I am developing I get the
>> following error:
>> Notice: session_start() [function.session-start]:
>> ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission
>> denied (13) in /var/www/MP2010-v2/challenge.php on line 2
>>
>> This started when I upgraded Ubuntu from relase 9.10 to 10.04.
>>
>> my directory has the following permissions
>> drwx-wx-wt 2 root root 4096 2010-10-12 07:19 php5
>>
>> First question: what is wrong and how do I fix it.
>> 2nd question: what is a t for other execute permission ?
>>
>> bill
>
> the answer to the 2nd question is that this is a "restricted deletion
> flag. Seems right.
>
> bill

Hi Bill,

Probably that happens because the user that runs PHP (via Apache)
doesn't have the rights to list the contents of /var/lib/php5.

I expect it will happen every request if you change the values for
session cleanup in php.ini.
; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.

session.gc_probability = 1
session.gc_divisor = 100

If you set them both to, say, 100: do you get that error every time?
I expect you will.

If so, that means PHP is unable to remove old session files.
If you don't fix it eventually your harddisk will flood over. ;-)


About your directory setting:
I thought that 't' was called sticky bit. (It will appear as 's' or 'S'
in owner or group column.)

I am not sure why your system is set up like that.
What you want is this:
Have a session directory that is:
- readable (listable) and
- writable (and thus deletable)
for the relevant user.
The relevant user is the one that your webserver (apache) uses.
On most systems that user is called 'www-data' or 'apache'. (I also saw
'nobody' a few times.)

How to fix it?
Disclaimer: I have no clue WHY your system is set up like that. Possibly
there is a some good reason I am unaware of. But since this isn't
working I doubt it is a good reason. ;-)
Maybe ask in an Ubuntu forum?

This is how I set up my rights on session storage directories:
[Assuming user www-data]

d rwx --- --- www-data www-data mysessionstoragedir

So that is full rights for the owner www-data on the sessiondir.

Hope this helps.

Regards,
Erwin Moller

--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: php://memory and php://temp
Next Topic: Interpret SimpleXMLElement Object
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 10:00:18 GMT 2024

Total time taken to generate the page: 0.04135 seconds