File and folder permissions settings in Magento

Source: Internet
Author: User
Tags chmod file permissions magento connect

SSH mode (for standalone servers or VPS)

The code is as follows Copy Code

Find. -type f-exec chmod 644 {};
Find. -type d-exec chmod 755 {};
chmod o+w var var/.htaccess app/etc
Chmod Mage
Chmod-r O+w Media

If is isn't working, try setting all directories to 777 by doing this:

Find. -type f-exec chmod 644 {};
Find. -type d-exec chmod 777 {};
chmod o+w var/.htaccess
Chmod Mage

Operations in Magento

For example, level Two menu is not available, Magento Connect is not available, pictures do not show, and so on, most of the reasons are file permissions are not set or improper settings caused. The following are the basic file and folder settings.

755 Permissions

The code is as follows Copy Code

Magento/app/etc
Magento/media
Magento/app
Magento/skin
Magento/var
Magento/var/.htaccess
Magento/js
Magento/downloader

644 Permissions

magento/index.php
magento/downloader/index.php


PHP Modify Permissions

The code is as follows Copy Code

<?php

# # Setup file 644, directory 755
function Alldirchmod ($dir = "./", $dirModes = 0755, $fileModes = 0644) {
$d = new Recursivedirectoryiterator ($dir);
foreach (New Recursiveiteratoriterator ($d, 1) as $path) {
if ($path->isdir ()) chmod ($path, $dirModes);
else if (Is_file ($path)) chmod ($path, $fileModes);
}
}

?>

?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.