当前位置: 移动技术网 > 科技>操作系统>Linux > Magento中文件与文件夹权限设置方法

Magento中文件与文件夹权限设置方法

2019年03月19日  | 移动技术网科技  | 我要评论
如:安装插件,批量导入,后台配置,等等让人头痛。现在提供两种方式处理该权限问题

ssh方式(适用于独立服务器或vps)


复制代码
代码如下:

find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
chmod o+w var var/.htaccess app/etc
chmod 550 mage
chmod -r o+w media
if that is not 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 550 mage


magento中操作

比如二级菜单不可用,magento connect 不可用,图片不显示等等,大部分原因都是文件权限没设置或者设置不当引起的。下面是基本的文件及文件夹设置。

755权限


复制代码
代码如下:

magento/app/etc
magento/media
magento/app
magento/skin
magento/var
magento/var/.htaccess
magento/js
magento/downloader
644权限
magento/index.php
magento/downloader/index.php

php修改权限

复制代码
代码如下:

<?php
## 设置文件644,目录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 );
}
}
?>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网