0

This is the error

RuntimeException: Unable to create the cache directory (1/25/20).

1- Changing the cache directory in the appKernel file didn't fix the problem

/*
        public function getCacheDir()
        {
            return '/mnt/symfony_ram_cache/cache/'.$this->environment;
        }
*/

2- Setting the permissions to "chmod 777 -R cache" didn't work, still throws the error

3- App works when I deactivate the twig cache (I obviously need it in production)

#Twig Configuration
twig:
   cache: false

4- It DOES create several folders in cache (in both prod and dev) when I empty the cache directoy and reload, so what means the rights are actually set properly

screenshot

5- Here is a screenshot of the error

error screenshot

6- PS: Updated to symfony 2.5.6 the twig bundle was updated but still have no luck

user3531149
  • 1,519
  • 3
  • 30
  • 48

3 Answers3

0

Maybe you should chown cache directory to user who fires up application (www-data?)?

0

Edit your

app/config/config.yml

And change this:

From:

twig:
     cache:            "%kernel.debug%"

To:

twig:
     cache:            "%kernel.cache_dir%/twig"
b101101011011011
  • 4,429
  • 1
  • 16
  • 7
0

I don't know what was wrong, I installed symfony2 from scratch again and now it works.

user3531149
  • 1,519
  • 3
  • 30
  • 48