Here is the problem.
Cache stores in app/cache folder. I'm currently work under dev environment and my cache stores in app/cache/dev folder. Problem appears when I use symfony console comand for cache clearing:
php app/console cache:clear
when I try to load my project localhost/symfony/dev_app.php I receive an error:
RuntimeException: Failed to write cache file
I've installed setfacl extension, because Debian does not support chmod a+ and here is what I've done:
At first, I checked which user used when http requests performed:
ps aux | grep http
ahmed 7219 0.0 0.0 7552 884 pts/0 S+ 19:51 0:00 grep http
Then I cleared app/cache folder by performing
rm -rf app/cache/*
Next step was:
setfacl -R -m d:u:ahmed:rwx,ahmed:rwx app/cache
As I understand, this command sets default permissions for user ahmed on app/cache folder and it current and new subfolders and files.
In my console I work under ahmed user.
After all this steps I loaded localhost/symfony/dev_app.php and cache was created. Then
php app/console cache:clear
And once again **ocalhost/symfony/dev_app.php* to create new cache. But I still receive this error
RuntimeException: Failed to write cache file "/var/www/local/symfony/app/cache/dev/classes.php".
So what am I doing wrong?
Here is the listing of getfacl for app/cache/dev
ahmed@ahmed:/var/www/local/symfony$ getfacl app/cache/dev
# file: app/cache/dev
# owner: root
# group: ahmed
# flags: -s-
user::rwx
user:ahmed:rwx
group::r-x
mask::rwx
other::r-x
default:user::rwx
default:user:ahmed:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
-dR
flags)? IIRC ACL must also be enabled on that partition. – kgildenps aux | grep http
is returning you the grep process itself. The web server is likely running under a different name. Try grepping forapache
or[a]apache
to not list the search process itself. – kgilden