作曲家更新的文件权限

The app/cache and app/logs folder mode has been set to 0777. And apache run user and group same with cli user. Running

php app/console cache-clear

works fine as well. But the problem is when composer update, I always get:

[InvalidArgumentException]
The directory "/home/userx/symfony/app/cache/dev/annotations" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does not support this, check out the acl package.

cache:clear [--no-warmup] [--no-optional-warmers]

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.

What could be the issue ? Thanks.

It looks like the cache warmup is responsible here. It creates file in app/cache/dev and app/cache/prod after you update composer.

You should make sure that all the folders inside app/cache and app/logs are writable, that is :

chmod -R 0777 app/cache app/logs

777 is maybe a bit too permissive but that will do if you work locally. If you're in a production environnement, you should chgrp instead and give rw permissions to the group only, not everybody.