4

I installed magento 2.3 in localhost (Ubuntu 19.04). and changed the ownership & permissions of install directory using the command

 sudo chown -R www-data:www-data /var/www/magentoProject
 sudo chmod -R 775 /var/www/magentoProject

and i included user to www-data group.

I installed composer globally. And whenever i run the composer command inside my project directory am getting the error as below.

enter image description here

I really appreciate any help you can provide.

4

2 回答 2

0

正如您在问题中所述,您有...

  • 将所有者和组更改www-data为您的项目
  • 将您的用户添加midhunwww-data组中
  • 授予项目目录组写入权限chmod 775

...但您想知道为什么不授予这些权限。

在您注销重新登录之前,不会应用您在 ubuntu 上的新组成员身份。因此,您实际上还不是该www-data组的成员!

另一种选择是使用su与您的用户一起切换到子shell,如下所示:

su -m -l - "$(whoami)"

这将立即应用新的组所有权。

于 2019-07-19T05:06:17.070 回答
0

尝试将文件的所有权更改为bin/magento您正在使用的用户composer

参考:https ://stackoverflow.com/a/56563434/4482269

于 2021-11-25T20:49:07.550 回答