cancel
Showing results for 
Search instead for 
Did you mean: 

Ownership of files not set to apache user after installing extension

Ownership of files not set to apache user after installing extension

I'm quite new to Magento and have no idea if this is regular behaviour, but it doesn't seem to me like it is.

 

Whenever I try to install an extension (through the extension manager), it successfully runs through all the tests, creates a backup and starts installing the extension. Whenever it completes, however, I get thrown out and all there is to see is an HTTP 500 error. 


This is then fixed by me running a chown command in terminal, setting the ownership of my Magento folder (and all underlying sub-folders/files) to the usergroup of www-data (the user running apache2).

 

After running this command everything works like it's supposed to and I get welcomed back into the system by a page stating the installation of the extension has succeeded. 

 

Is there any way to make it so that the ownership of the added files/folders is automatically set to the usergroup of the apache2 user upon installation?

 

I'm running the latest version of Magento (2.2.2) on a Ubuntu 16.04 dedicated server.

5 REPLIES

Re: Ownership of files not set to apache user after installing extension

Have you checked the instructions provided in this official guide? http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Ownership of files not set to apache user after installing extension

I have and, to my knowledge, all these permissions are set correctly.

Re: Ownership of files not set to apache user after installing extension

What user and group to the files that get installed by Magento get added as?

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Ownership of files not set to apache user after installing extension

Oddly enough, the extension files themselves don't seem to be the problem.

 

Their ownership gets assigned to my Magento admin user and the www-data group. Yet, I still get the HTTP 500 error, which is fixed by chowning the entire Magento installation folder.

Re: Ownership of files not set to apache user after installing extension

Narrowing down precisely which files have the problematic permissions would be useful. It may be that it's still the extension files. Is there a group www-data that the www-data apache user is also in? 

 

Can you also go into the installed extension directory and provide a list of the permissions that are assigned, please?

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!