This question has been asked several times but none of the solutions fix it in my situation.
I am running Apache on Mac OSX Lion. This http://localhost/Symfony/web/config.php URL triggers 2 major problems:
Change the permissions of the "app/cache/" directory so that the web server can write into it.
Change the permissions of the "app/logs/" directory so that the web server can write into it.
Following the guide under “Setting up Permissions”:
rm -rf app/cache/*
rm -rf app/logs/*
sudo chmod +a "_www allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
That doesn’t solve the problems, so then I tried:
sudo chmod -R 777 app/cache
That doesn’t work either. Any ideas how to fix this?
Some preliminary explanations:
app/cachedirectory.app/logsdirectory.Some words about Apache:
userand a specificgroup(usuallywww-datafor both, but you have to check your installation to find the used ones. For example, if you search in the/etc/apache2/envvarsin Linux, you will have two variablesAPACHE_RUN_USER=www-dataandAPACHE_RUN_GROUP=www-data).userandgroup.Analyze of your problems:
First of all you have errors like:
because your
app/cacheandapp/logsfolders are not writable for your Apacheuserandgroup.Secondly, by executing:
you are modifying the Access Control List (ACL) of the
app/cacheandapp/logsfolders in order to grant some permissions towhoami(basically you) and to_www.This approach does not work and can have two origins:
You are modifying ACLs, but are your kernel and your file system configured to take into account ACLs?
You are giving some permissions to
whoamiand to_www, but have you checked that your Apache instance runs under one of these users?Thirdly your colleagues solve the problem by executing:
This approach works because of two reasons:
777), so you are sure that at least your Apache user and group have also the needed permissions to write inapp/cache.-R), so all the nested folders created in theapp/cachedirectory are also concerned by the new permissions.Simple solution:
Delete the content of your
app/cacheandapp/logsfolders:Give all permissions (reads and writes) to your
app/cacheandapp/logsfolders:Remarks: