我有一个Pimcore项目根文件夹,该文件夹由www-data:www-data
递归拥有。
如果我使用sudo composer update
,一切正常,但是将使用root所有者设置许多文件,这可能会导致进一步的问题。
如果我使用sudo -u www-data composer update
,则会收到 RuntimeException :
file_get_contents(/home/me/.composer/config.json): failed to open stream: Permission denied
如果我使用sudo -u me composer update
,则有时会得到另一个 RuntimeException :
An error occurred when executing the "'cache:clear --no-warmup'" command:
Fatal error: Uncaught RuntimeException: Unable to write in the cache directory (/var/www/html/pimcore/skeleton/var/cache/dev)
如果我将根文件夹的所有权更改为me:www-data
,则会出现 RuntimeException 错误,因为某些文件夹对于组www-data
是不可写的,例如此文件夹{{ 1}}的权限设置为/var/www/html/pimcore/skeleton/var/cache/dev/twig
。
我的根文件夹应该属于哪个drwxr-xr-x
,以及我应该如何运行user:group
?