How to set up cache with PHP (file system perms)

software development

#1

I am installing OpenPhoto (a PHP program) and am trying to configure its cache directory.

If the cache directory is not set to 0755, then Apache cannot serve the files in the cache directory. However, I would prefer to use tighter permissions.

What’s the best way to approach this problem?

– jeff


#2

I’m unsure why it would seemingly require 755.

You could try adding a highly restrictive .htaccess file in the cache directory if you wanted to.

Order Allow,Deny Deny from All


#3

If you need to serve files from the directory, it needs to be set to something like 755 (and not have a restrictive .htaccess).


#4

cache 700 with restrictive .htaccess has worked flawlessly on DreamHost (for me) since day one.

You might need to take a look at how OpenPhoto is handling the cached files.


#5

OpenPhoto places the cached files in a directory which is accessed directly by Apache (and not via the PHP scripts). Settings perms to 700 causes failure, which I assume is because Apache can’t access the directory (makes sense if the Apache process is running under some uid that is different than mine).


#6

Have you tried 750 ?