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.

Midhun Lal
  • 87
  • 3
  • 11

2 Answers2

0

As you've stated in your question you have ...

  • changed the owner and group to www-data for your project
  • added your user midhun to the www-data group
  • gave the project-directory group-write permissions chmod 775

... but you're wondering why those permissions aren't granted.

Your new group membership on ubuntu isn't applied until you log out and log back in. Therefore you're effectively not yet a member of the www-data group!

Another option is to use su to switch into a subshell with your user like this:

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

This will apply the new group ownership right away.

Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130
0

try changing the ownership of bin/magento file to the user you are using for composer

Reference: https://stackoverflow.com/a/56563434/4482269

Wolfack
  • 2,667
  • 1
  • 26
  • 50