Symfony2 Exception on web/web_dev.php

Following the Symfony2 guide it says to view web/web_dev.php but I get a exception.. The app/check.php is all fine except one optional test fails:

[[WARNING]] Checking that the intl ICU version is at least 4+: FAILED
            *** Upgrade your intl extension with a newer ICU version (4+) ***

This is the exception:

RuntimeException: Unable to create the cache directory (/var/www/projectname/www/Symfony/app/cache)
in /var/www/projectname/www/Symfony/app/bootstrap.php.cache line 1197
at Kernel->buildContainer() in /var/www/projectname/www/Symfony/app/bootstrap.php.cache line 1138
at Kernel->initializeContainer() in /var/www/projectname/www/Symfony/app/bootstrap.php.cache line 869
at Kernel->boot() in /var/www/projectname/www/Symfony/app/bootstrap.php.cache line 1038
at Kernel->loadClassCache() in /var/www/projectname/www/Symfony/web/app_dev.php line 12

Thanks in advance for anyone who gives me light on how to solve this

Upvotes: 10

Views: 13795

Answers (3)

chemalarrea
chemalarrea

Reputation: 1405

Referring to "Setting up Permissions" in Symfony2 documentation:

http://symfony.com/doc/current/book/installation.html

  1. Using ACL on a system that supports chmod +a CODE: SELECT ALL sudo chmod +a "apache allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

Results in: chmod: invalid mode: `+a'

  1. Using Acl on a system that does not support chmod +a CODE: SELECT ALL sudo setfacl -R -m u:apache:rwx -m u:myname:rwx app/cache app/logs

Results in: sudo: setfacl: command not found

  1. Without using ACL Uncommenting "//umask(0000);"

Upvotes: 3

F.Pole
F.Pole

Reputation: 96

just for people's info. I had the same issue when working locally on a mac and had to change the permissions on two directories: app/cache app/logs

'Command i' on each directory and set the permissions to 'Read & Write' for everyone (and applied to Enclosed Items) did the trick.

Upvotes: 6

Maerlyn
Maerlyn

Reputation: 34107

The error message is quite clear: it is unable to create the cache directory - the user apache runs as has no write permission for your project root.

Assuming it's a development environment, I recomment chowning the project folder to your user and the webserver's group.

Upvotes: 9

Related Questions