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?
Source:
http://symfony.com/doc/current/book/installation.html#configuration-and-setupThe guide under the "Setting up permissions" says that if your system doesn't support chmod +a you have to do this:
If that doesn't work try this:
First solution worked for me. I hope it helps someone with the same type of issue.
Some preliminary explanations:
app/cache
directory.app/logs
directory.Some words about Apache:
user
and a specificgroup
(usuallywww-data
for both, but you have to check your installation to find the used ones. For example, if you search in the/etc/apache2/envvars
in Linux, you will have two variablesAPACHE_RUN_USER=www-data
andAPACHE_RUN_GROUP=www-data
).user
andgroup
.Analyze of your problems:
First of all you have errors like:
because your
app/cache
andapp/logs
folders are not writable for your Apacheuser
andgroup
.Secondly, by executing:
you are modifying the Access Control List (ACL) of the
app/cache
andapp/logs
folders 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
whoami
and 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/cache
directory are also concerned by the new permissions.Simple solution:
Delete the content of your
app/cache
andapp/logs
folders:Give all permissions (reads and writes) to your
app/cache
andapp/logs
folders:Remarks: