How to fix file permissions readiness check issues in Magento 2

- E-Commerce, Magento 2

Magento 2 export CLI

When file permissions are not set properly, the system displays an error message. Below, we describe the issue and propose several resolutions. For more useful tips, follow this link: Magento 2 Developer’s Cookbook

'

The issue

When permissions are not set properly, the Web Setup Wizard displays a message similar to the following one:

It usually happens when directories in the Magento file system are not writable by the web server user; if applicable, the Magento file system owner should also have these permissions.

The solution

The way how you fix file permissions readiness check issues in Magento 2 depends on the following conditions:

  • One user setup: the same user logs in to the Magento server and runs the web server (shared hosting environments);
  • Two users setup: one user logs in to the Magento server, another one runs the web server (private hosting or own server).

One-user setup

Keep up with the following prerequisites:

  • Magento is installed in /var/www/html/magento2
  • You have command-line access

Next, enter the following command:

Two-user setup

If there is no command-line access, you can use an FTP client or a file manager app to set permissions.

Keep up with the following prerequisites:

  • Magento is installed in /var/www/html/magento2
  • The web server group name is apache

Next, enter the following command:

If you cannot change permissions as a Magento file system owner, enter the following command as a user with root privileges:

For further information, read this article: File permissions readiness check issues.

'