Symfony 2 cache clearing issue

狂风中的少年 提交于 2019-12-03 00:52:47

You need to get your access rights on both cache & logs folders. To do that, you can follow the indications given here : http://symfony.com/doc/current/book/installation.html#configuration-and-setup

There are several ways, depending on your OS (replace www-data with your apache user):

If it supports chmod +a:

$ 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 "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

Else, if it supports setfacl (see https://help.ubuntu.com/community/FilePermissionsACLs):

$ 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

Else, put those lines in the beginning of app/console, web/app.php & web/app_dev.php (not recommended):

umask(0002); // This will let the permissions be 0775

// or

umask(0000); // This will let the permissions be 0777

in Symfony3 folders with cache moved from app to var, so the command will be:

$ rm -rf var/cache/*
$ rm -rf var/logs/*
$ sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs

You need to get your access rights on both cache & logs folders. To do that, you can follow the indications given here :

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!