i installed the sonata admin bundle. After installation i refresh my page there is the cache problem then i use
rm -rf app/cache app/log
for remove the cache.then i also create the director using the command
mkdir app/cache app/log
then i got the new problem like this
Runtime Exception : Unable to create the cache directory (/var/www/sonata/app/cache/dev). Please help .
On a mac computer it will be:
If none of above work to you, call a "phpinfo()" on your php file and find for "User/Group" value. That's the user group to give permission to.
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
and
$ chown -R www-data:www-data app/log
on the command line.
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.
This solution is correct : https://stackoverflow.com/a/20128013/2400373
But is necessary change the 2 commands in
Symfony3
: First you should is inside the folder of project:After delete the cache:
Regards
Changing the CHMOD might help but in case the cache annoys you during the deveopment you can just deactivate it. Navigate to your app config file (located in ../app/config/config.yml from your root directory). Scroll to the twig configuration settings (under twig:) and change the cache value (which should be pointing to the cache directory) to false like so:
If you do not see any cache configuration entry, simply add the line above.
And for centos:
if you're coming here for Symfony Help you might have to do this as well if you delete the entire app/logs folder
What is likely happening is that you are trying to create the file under apache/nginx. By default apache or nginx has umask set to 0022.
You will need to manually set the umask to 0002, and reset it back to its previous setting before you can create the directories.