[FX.php List] No GC (Garbage Collection) in IIS installation

Andrew Denman adenman at tmea.org
Mon Mar 22 01:10:57 MDT 2010


Jonathan,

For permissions on Windows/IIS, usually the only IIS account that needs write/delete access to the temp folder is the anonymous access user account (the name starts with 'IUSR_'). I have also seen the 'Network Service' group mentioned as being needed in some cases.

If I remember correctly, the trailing slash is not needed, but if included it does not seem to affect path resolution (the system must ignore two slashes together).

Lack of outcry over the problem probably stems from many things: they don't use IIS (Linux/Mac seems quite popular in the FX.php demographic), site is not as busy, they otherwise haven't noticed (error logs, what error logs?), they don't use sessions, they do a custom set-up where they've explicitly assigned permissions, or used another temporary path with the required permissions (ie: Zend installations).

Andrew Denman
adenman at tmea.org

On Mar 20, 2010, at 2:08 PM, Jonathan Schwartz wrote:

> I asked my IT guy to adjust the permissions. He said he applied 
> "Eveyyone/Full", so I assume that means 777.  We will now evaluate 
> the need to dial that back.
> 
> And, I can't tell you if the trailing slash s needed, but it is there 
> now.  I couldn't do too many iisrestarts during the day.
> 
> Will report back if I find that it is not needed.
> 
> What I can't figure out is why more folks haven't found this to a 
> problem.  This is a by-the-books FMS  10 Server install with PHP API 
> deployed.  It installs the php.ini with blank session path.
> 
> So why isn't anyone else screaming about 100,000's files stacking up?
> 
> J
> 
> 
> At 7:47 PM +0100 3/20/10, Leo R. Lundgren wrote:
>> Also, was/is the / at the end of the path required?
>> 
>> 20 mar 2010 kl. 19.34 skrev Leo R. Lundgren:
>> 
>>> Oh. Glad to hear this!
>>> 
>>> For reference (and curiosity :), what did you change the 
>>> permissions to? Are they secure now, you didn't to the equivalent 
>>> of chmod 777 I presume? =)
>>> 
>>> 
>>> 20 mar 2010 kl. 19.29 skrev Jonathan Schwartz:
>>> 
>>>> Yes! Yes! Yes! Yes!
>>>> 
>>>> After permissions were changed, files instantly dropped from 
>>>> 100,000 to less than 100.
>>>> 
>>>> This solves a years-long frustration.
>>>> 
>>>> Thank You!
>>>> 
>>>> Jonathan
>>>> 
>>>> At 7:02 PM +0100 3/20/10, Leo R. Lundgren wrote:
>>>>> Maybe!
>>>>> 
>>>>> While Googling before I noticed there was a lot of discussion 
>>>>> about permission denied related to this error. So I guess that if 
>>>>> you now get this error, it is at least finding a folder, and then 
>>>>> you can go on searching about the permission problems.
>>>>> 
>>>>> 
>>>>> 20 mar 2010 kl. 18.55 skrev Jonathan Schwartz:
>>>>> 
>>>>>> Back with some more answers....
>>>>>> 
>>>>>> I don't think that it was finding the folder as C:\WINDOWS\Temp.
>>>>>> 
>>>>>> When I changed  the slahes to :C:/WINDOWS/Temp/, I got a 
>>>>>> permissions error. Note, I had also added a trailing slash. Nit 
>>>>>> sure if it matters.
>>>>>> 
>>>>>> So maybe it actually found the right folder and just needs 
>>>>>> permissions set.
>>>>>> 
>>>>>> Stay tuned...
>>>>>> 
>>>>>> 
>>>>>> Jonathan
>>>>>> 
>>>>>> 
>>>>>> At 10:44 AM -0700 3/20/10, Jonathan Schwartz wrote:
>>>>>>> Great answers, Leo.
>>>>>>> 
>>>>>>> This provides the basis for further research.  BTW, the path 
>>>>>>> was originally blank in the ini, with no GC occurring.  Next, I 
>>>>>>> entered a path in the ini, using the path where I found the 
>>>>>>> files: C:\WINDOWS\Temp. Still no GC.
>>>>>>> 
>>>>>>> I will try your suggested experiments.
>>>>>>> 
>>>>>>> Stay tuned....
>>>>>>> 
>>>>>>> Jonathan
>>>>>>> 
>>>>>>> At 6:14 PM +0100 3/20/10, Leo R. Lundgren wrote:
>>>>>>>> Interesting.
>>>>>>>> 
>>>>>>>> Did you change the session.save_path in the php.ini file, or 
>>>>>>>> did you do it using PHP code? Can you verify that the path is 
>>>>>>>> really what you indended it to be, and that it hasn't been 
>>>>>>>> evaluated different, for example some chars being escaped and 
>>>>>>>> getting another meaning or something like that? Also, did you 
>>>>>>>> try using / instead of \ in the path? Just a thought.
>>>>>>>> 
>>>>>>>> I think that in any case, the problem is apparently that the 
>>>>>>>> session extension fails to open the directory in question. The 
>>>>>>>> code in the extension looks like this:
>>>>>>>> 
>>>>>>>> static int ps_files_cleanup_dir(const char *dirname, int 
>>>>>>>> maxlifetime TSRMLS_DC)
>>>>>>>> {
>>>>>>>> 	<snip>
>>>>>>>> 
>>>>>>>> 	dir = opendir(dirname);
>>>>>>>> 	if (!dir) {
>>>>>>>> 		php_error_docref(NULL TSRMLS_CC, E_NOTICE, 
>>>>>>>> "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, 
>>>>>>>> strerror(errno), errno);
>>>>>>>> 		return (0);
>>>>>>>> 	}
>>>>>>>> 
>>>>>>>> 	<snip>
>>>>>>>> }
>>>>>>>> 
>>>>>>>> So I guess that's about it. Something is wrong with the access 
>>>>>>>> to that directory :) I don't know if it would give a specific 
>>>>>>>> error message if the folder it tries to find doesn't exist, so 
>>>>>>>> maybe this is the problem?
>>>>>>>> 
>>>>>>>> You could try changing the path to something you know doesn't 
>>>>>>>> exist, and compare the error message. If you want to provoke 
>>>>>>>> the problem on each request, try changing the settings like 
>>>>>>>> this in php.ini:
>>>>>>>> 
>>>>>>>> 	session.gc_probability = 1
>>>>>>>> 	session.gc_divisor = 1
>>>>>>>> 
>>>>>>>> -|
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 20 mar 2010 kl. 17.48 skrev Jonathan Schwartz:
>>>>>>>> 
>>>>>>>>> Hi Folks,
>>>>>>>>> 
>>>>>>>>> Breaking out from the previous post....
>>>>>>>>> 
>>>>>>>>> My  problem is that a Windows system is NOT clearing session 
>>>>>>>>> files, and producing this error from time to time:
>>>>>>>>> 
>>>>>>>>> ps_files_cleanup_dir:opendir(C:\WINDOWS\TEMP) failed: No error (0)
>>>>>>>>> 
>>>>>>>>> The original phpini had no entry for the path. I added 
>>>>>>>>> "C:\WINDOWS\Temp" ,but still no GC.
>>>>>>>>> 
>>>>>>>>> Note...the error doesn't say "permission denied".
>>>>>>>>> 
>>>>>>>>> Any clues?
>>>>>>>>> 
>>>>>>>>> Thanks
>>>>>>>>> 
>>>>>>>>> Jonathan
>>>>>>>>> --
>>>>>>>>> Jonathan Schwartz
>>>>>>>>> Exit 445 Group
>>>>>>>>> jonathan at exit445.com
>>>>>>>>> http://www.exit445.com
>>>>>>>>> 415-370-5011
>>>>>>>>> _______________________________________________
>>>>>>>>> FX.php_List mailing list
>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> -|
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> FX.php_List mailing list
>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Jonathan Schwartz
>>>>>>> Exit 445 Group
>>>>>>> jonathan at exit445.com
>>>>>>> http://www.exit445.com
>>>>>>> 415-370-5011
>>>>>>> _______________________________________________
>>>>>>> FX.php_List mailing list
>>>>>>> FX.php_List at mail.iviking.org
>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Jonathan Schwartz
>>>>>> Exit 445 Group
>>>>>> jonathan at exit445.com
>>>>>> http://www.exit445.com
>>>>>> 415-370-5011
>>>>>> _______________________________________________
>>>>>> FX.php_List mailing list
>>>>>> FX.php_List at mail.iviking.org
>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>> 
>>>>> 
>>>>> 
>>>>> -|
>>>>> 
>>>>> _______________________________________________
>>>>> FX.php_List mailing list
>>>>> FX.php_List at mail.iviking.org
>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>> 
>>>> 
>>>> --
>>>> Jonathan Schwartz
>>>> Exit 445 Group
>>>> jonathan at exit445.com
>>>> http://www.exit445.com
>>>> 415-370-5011
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>> 
>>> 
>>> 
>>> -|
>>> 
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
>> 
>> 
>> -|
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> 
> -- 
> Jonathan Schwartz
> Exit 445 Group
> jonathan at exit445.com
> http://www.exit445.com
> 415-370-5011
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list


More information about the FX.php_List mailing list