Magento – Why is the file permissions check failing

magento2

The File Permissions Check fails during the Readiness Check for Magento 2.1.0 Setup. I am consulting Set pre-installation file system ownership and permissions but to no avail.

I am running Fedora on an Amazon EC2 instance. The web server user and group is apache, command line user is fedora and currently the owner and group of the Magento install directory and its contents is root.

I have tried setting the group and owner of the Magento install directory and its contents to several combinations including apache:apache, root:root (current), fedora:apache and fedora:fedora. I have also recursively set the permissions to 664 and 644 for files and 755 for directories yet,

  • /var/www/html/app/etc
  • /var/www/html/var
  • /var/www/html/pub/media ; and
  • /var/www/html/pub/static

are apparently not writable.

Can anyone share some insight? This is my first time setting up Magento not using a quick start or quick install option and using an AWS VPC.

EDIT: I have performed a clean install, the Magento install dir is owned by a seperate user (magento_user) that belongs to the web server group apache. All files and directories are owned by magento_user:apache and permissions for var, pub etc. updated to 0664 and 2755 for files and directories respectively. The bin/magento to 0744.

Best Answer

Just for the record - probably will help somebody - I had the same issue installing Magento 2.1.8 and, changing the owner of those 4 folders/directories to the user apache runs, made it pass the File Permissions Check right away.

This is in CentOS, "sudo" makes it run as root, so adapt as needed:

sudo chown -R apache:apache /path/to/magento/var/  
sudo chown -R apache:apache /path/to/magento/pub/media/  
sudo chown -R apache:apache /path/to/magento/pub/static/  
sudo chown -R apache:apache /path/to/magento/app/etc/

I've been trying everything I found, from devdocs permissions guide to chmod 777 (775, 755, 700, ...), selinux disable, nothing worked until I tried the above. Changing the owner of those folders to apache user.

Related Topic