如:安裝插件,批量導(dǎo)入,后臺(tái)配置,等等讓人頭痛?,F(xiàn)在提供兩種方式處理該權(quán)限問(wèn)題
SSH方式(適用于獨(dú)立服務(wù)器或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中操作
比如二級(jí)菜單不可用,Magento Connect 不可用,圖片不顯示等等,大部分原因都是文件權(quán)限沒(méi)設(shè)置或者設(shè)置不當(dāng)引起的。下面是基本的文件及文件夾設(shè)置。
755權(quán)限
magento/app/etc
magento/media
magento/app
magento/skin
magento/var
magento/var/.htaccess
magento/js
magento/downloader
644權(quán)限
magento/index.php
magento/downloader/index.php
php修改權(quán)限
?php
## 設(shè)置文件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 );
}
}
?>