I installed the Sonata admin bundle.
After installation i refresh my page there is the cache problem then i use the following command to remove the cache:
rm -rf app/cache app/log
Then I recreate the directory:
mkdir app/cache app/log
But I got the following error:
Runtime Exception : Unable to create the cache directory (/var/www/sonata/app/cache/dev).
It looks like a file/directory permission problem. The directory has to be writeable by the webserver. After creating the directory you should adjust the permissions with
chown -R www-data:www-data app/cache chown -R www-data:www-data app/log
Or for Symfony 4+:
chown -R www-data:www-data var
This only works on linux systems. The user and group depends on your distribution. On Debian and Ubuntu this should be www-data
, on CentOS it's afaik apache
.
Another solution would be not to delete the whole folders but only their contents via
$ rm -rf app/log/* app/cache/*
But please be careful with this command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With