cancel
Showing results for 
Search instead for 
Did you mean: 

Magento2 installation hell

Re: Magento2 installation hell

Hi all,

 

I have had this issue too. So you have set the files/folders permissions as recommended by Magento, that is fine, don't touch that any more (for now).

 

Issue:

 

Magento recommends that the user who owns the magento directory just needs to belong to the webserver group (ie with apache/nginx ownership $user:www-data). THIS DOES NOT WORK!

 

Solution: 

 

Do what you need to do in your Magento folder, and then change ownership of Magento directory from (user:www-data) to (www-data:www-data)

 

For example in Linux Ubuntu CLI

 

 

cd /var/www/html/[MAGENTOINSTALLDIRECTORY]

sudo chown -R www-data:www-data .

 

 

This will get things working. However, the pain here is that every time you want to make changes to files in the Magento directory, you have to revert ownership to the user, do your thing, and then change ownership back to the webserver user again

 

 

Conclusion:

 

I don't understand why this happens. If we look at the file permissions, most are 664. Now that means user and group have the same permission! So why www-data has to be the user baffles me. Can anyone in the know shed some light on that? My user does belong to the webserver group, done word for word according to documentation, using NGINX on UBUNTU 16.10

Re: Magento2 installation hell

you can edit the file: /etc/php/7.1/fpm/pool.d/www.conf

here you can edit the user and group php runs as. the default is www-data but i changed both the group and user to magento. problem solved Smiley Happy. don't forget to restart php-fpm after the change