As described by the Symfony2 documentation,
you must set the proper permissions for the app/cache and app/logs directories, since they need to be writable by your webserver.
NOTE : This feature is not available for versions prior to 2.1.X
Settings
There are 4 parameters to care about when using this task:
:writable_dirs: This is where you specifiy the relative path of dirs that must be writable by your webserver user (i.e. app/cache app/logs for Symfony2):webserver_user: This is the name of your webserver_user (i.e www-data for many Apache distributions):permission_method: The method to use for setting permissions (supported values are:acl,:chmodand:chown):use_set_permissions: This parameter defines whether to run theset_permissionstask. This param isfalseby default (supported valuestrue,false)
NOTE : The
:aclmethod relies on thesetfaclcommand which may not be available by default on your system (i.e. Debian). You’ll need to enable ACL support before using it.
NOTE : The
:chmodmethod uses+amode which may not be available on your system (i.e. Debian). You’ll need to choose rather:aclor:chown, first one is preferred.
NOTE : The
:chownmethod must only be used if neither:aclnor:chmodcan be used on your system. Please note that to use this method you have to set the:use_sudovariable totrue!
Here is a basic example of what these parameters might look like in your deploy.rb:
set :writable_dirs, ["app/cache", "app/logs"]
set :webserver_user, "www-data"
set :permission_method, :acl
set :use_set_permissions, trueNOTE : For multistage usage you just have to override these variables on stage specific files if ever needed.