Tuesday 28 November 2017

Magento 2 : Folders and Files Permissions. Command


The web server user must have write access to the following files and directories:

PHP version 7.

PHP Extensions Check
    curl.
    dom.
    iconv.
    mcrypt.
    simplexml.
    spl.
    xsl.
    intl.
    mbstring.
    ctype.
    hash.
    openssl.
    pdo_mysql.
    soap.
    zip.
    xmlwriter.
    phar.
    pcre.
    gd.
   
File Permission Check

    ./app/etc             writable directory permission.
    ./var                  writable directory permission.
    ./pub/media          writable directory permission.
    ./pub/static          writable directory permission.
    ./generated          writable directory permission.


Set permission  Command:

find . -type f -exec chmod 644 {} \;     // 644 permission for files
find . -type d -exec chmod 755 {} \;    // 755 permission for directory 
find ./var -type d -exec chmod 777 {} \;   // 777 permission for var folder 
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
find ./app/etc -type d -exec chmod 777  {} \;
chmod 644 ./app/etc/*.xml
chmod 777 ./var/.htaccess
chmod 777 ./app/etc/di.xml
chmod 777 ./app/etc/vendor_path.php
chmod 777 ./app/etc/NonComposerComponentRegistration.php
chmod 777 ./pub/media/customer/.htaccess
chmod 777 ./pub/media/theme_customization/.htaccess
chmod 777 ./pub/media/composer.json
chmod 777 ./pub/media/import/.htaccess
chmod 777 ./pub/media/.htaccess
chmod 777 ./pub/media/downloadable/.htaccess
chmod 777 ./pub/media/LICENSE.txt
chmod 777 ./pub/static/.htaccess
chmod 777 ./generated
chmod 777 ./generated/.htaccess


Thanks,
Kuldeep Singh


No comments:

Post a Comment