Symfony2 cache recreation - write permission fail
The web server group (probably www-data
) needs to be able to write to the cache and so does your user. Your user (ahmed) should be a member of the www-data group (note that you will have to re-login for group membership to take effect). Setting the setgid
bit (+s
) on app/cache and app/logs will ensure that files and directories your user creates within those will maintain group ownership by www-data
. Uncomment the umask(0002)
line within app_dev.php
so that files created by www-data
will maintain group ownership, make sure YOUR user has a umask of 0002 (type umask
at prompt to see, or umask 0002
to set, and google for help on setting this at login) and ensure that your permissions look something like:
drwxrwsr-x 13 user www-data 4096 2013-05-10 11:05 dev
When your user ahmed creates files/directories within the directory owned by ahmed.www-data
with +s
, you should find that they are also owned by ahmed.www-data
.