PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Caching » Cache_Lite » Bug #8246

Cache Dir

Details

Submitted2006-07-19 12:07 UTC
Fromfhoenig at kargo dot com
StatusBogus
PackageCache_Lite
PHP Version5.0.4
OSLinux 2.6.15-1.1830_FC4smp #1 SM
Roadmaps(Not assigned)

Comments

[2006-07-19 12:07 UTC] fhoenig at kargo dot com

Description:
------------
When I use any cache sample identically copied from the documentation, it works only if the directory is /tmp/. Any other directory with same permissions does write the cache files, but it always turns out as a miss on Get() call.

Test script:
---------------
any from the docs.

[2006-07-19 18:43 UTC] fab at php dot net

can you turn on "debug mode" ?

$cache->setToDebug()

before save() and get() ?

Thanks for your feedback

[2006-07-24 15:48 UTC] fhoenig at kargo dot com

I have resolved the problem. It seems to only work in a directory with the sticky bit on.

[2006-09-06 07:45 UTC] jsa1971 at gmail dot com

Too bad Florian left so quickly...this is a problem for me as well, but setting the sticky bit on my cacheDir is not working (hased directory level=0).

I turned on setToDebug and get the "Cache_Lite : Unable to write cache file " error message everywhere.

I remove the error-control in front of fopen (Lite.php, line ~762) and get plenty of

Warning: fopen(/opt/preamp/local/cache/preamp.PackageReader.MAIN/cache_c21f969b5f03d33d43e04f8f136e7682_65c852a7021bb84450fd1ce3b444029b) [function.fopen]: failed to open stream: Permission denied in /opt/preamp/3p/PEAR/Cache/Lite.php on line 762

Here's what one cache looks like. all caches I'm trying to operate look the same:

Cache_Lite Object ( [_cacheDir] => /opt/preamp/local/cache/databridge.rs/ [_caching] => 1 [_lifeTime] => 300 [_fileLocking] => 1 [_refreshTime] => [_file] => [_fileName] => [_writeControl] => 1 [_readControl] => 1 [_readControlType] => crc32 [_pearErrorMode] => 1 [_id] => [_group] => [_memoryCaching] => 1 [_onlyMemoryCaching] => [_memoryCachingArray] => Array ( ) [_memoryCachingCounter] => 0 [_memoryCachingLimit] => 1000 [_fileNameProtection] => 1 [_automaticSerialization] => 1 [_automaticCleaningFactor] => 100 [_hashedDirectoryLevel] => 0 [_hashedDirectoryUmask] => 448 [_errorHandlingAPIBreak] => ) )

[2006-09-06 14:09 UTC] jsa1971 at gmail dot com

Sorry Fabien, this might not be welcome news, but in my case there was a solution - my cacheDirs were 0600; changing them to 0700 solved the problem quickly. If an issue existed, it's still out there...sorry about the noise

[2006-09-14 17:34 UTC] fab at php dot net

not a problem, I was away from my computer :-)

of course, cache_lite can't work with 0600 perms

thanks for the feedback

[2006-09-14 17:35 UTC] fab at php dot net

Thank you for taking the time to write to us, but this is not
a bug.

so i close the bug