Unable to write cache file” problem in Symfony 2


One common issue in Symfony 2 projects is that the “app/cache” and “app/logs” directories must be writable both by the web server and the command line user. On a UNIX system, if your web server user is different from your command line user, you can run the following commands just once in your project to ensure that permissions will be setup properly. 

Simply type the following command:

 

sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

One thought on “Unable to write cache file” problem in Symfony 2

Leave a comment