Magento 2 Permission Setup Guide: A Beginner-Friendly Tutorial

Welcome to our Magento 2 Permission Setting tutorial! In this post, we'll go over how to set the correct file and folder permissions for your Magento website to ensure that it runs securely and efficiently.

I. Permission setting basics: Each file and folder has specific permission settings in the system that are used to control access to those files and folders by different users. Permissions are usually represented by a three-digit number, with each digit representing the permission level for a different group of users (file owner, user group, other users). For example, the number 6 represents read-write permissions, while 7 represents read-write-execute permissions.

图片[1]-Magento 2 权限设置指南:初学者友好教程-光子波动网 | WordPress教程、Elementor教程与故障修复

II. Document permission settings:

  1. Open a terminal or command prompt.
  2. utilization cd command navigates to the Magento installation directory.
  3. Enter the following command to set the permissions of all files to 644 (the owner of the file can read and write, others can only read):
find . -type f -exec chmod 644 '{}' \;.

Third, folder permission settings:

  1. In the same terminal, enter the following command to set the permissions of all folders to 755 (the owner of the file can read, write, and execute; others can only read and execute):
find . -type d -exec chmod 755 '{}' \;.

IV. Special directory permission settings:

  1. Magento requires files to be written in certain directories such as var,pub/media respond in singing pub/staticThe
  2. To set 777 permissions (read-write execution for all users) for these directories, use the following command:
find . /var -type d -exec chmod 777 {} \;.
find . /pub/static -type d -exec chmod 777 '{}' \;
find . /pub/media -type d -exec chmod 777 '{}' \; find .
图片[2]-Magento 2 权限设置指南:初学者友好教程-光子波动网 | WordPress教程、Elementor教程与故障修复

Attention:

  • Be especially careful when using 777 permissions, as it allows all users to perform any operation on a file or folder and may be a security risk.
  • Before running these commands, make sure you have sufficient privileges (root or administrator privileges may be required).

With the above steps, you can set appropriate file and folder permissions for your Magento website to enhance security and stability. If you encounter difficulties in performing these steps, it is recommended to consult a professional IT expert or the Magento community for help.

图片[3]-Magento 2 权限设置指南:初学者友好教程-光子波动网 | WordPress教程、Elementor教程与故障修复

Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
客服微信
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: [email protected]
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by Harry
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments