Symfony 2 can’t not write cache files

1. Using ACL on a system that supports chmod +a

Many systems allow you to use the “chmod +a” command. Try this first, and if you get an error – try the next method:

rm -rf app/cache/*
rm -rf app/logs/*

sudo chmod +a “www-data allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs
sudo chmod +a “yourname allow delete,write,append,file_inherit,directory_inherit” app/cache app/logs

2. Using Acl on a system that does not support chmod +a

Some systems don’t support “chmod +a”, but do support another utility called “setfacl”. You may need to enable ACL support on your partition and install “setfacl “before using it (as is the case with Ubuntu), like so:

sudo setfacl -R -m u:www-data:rwx -m u:yourname:rwx app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:yourname:rwx app/cache app/logs
Share

Leave a Reply