运行Magento需要哪些权限?

010*_*101 8 magento

Magento的文件告诉我们这样做:

chmod -R o+w media var
chmod o+w app/etc
Run Code Online (Sandbox Code Playgroud)

这让我们超越了安装程序.

接下来,我想从Magento Connect下载主题.不幸的是,这是一个似乎与权限相关的错误.

Settings has not been loaded. Used default settings
Config file does not exists please save Settings
Warning: Your Magento folder does not have sufficient write permissions.
Run Code Online (Sandbox Code Playgroud)

通过它需要什么权限?

我也看到有关连接字符串的错误.

Connection string is empty
Run Code Online (Sandbox Code Playgroud)

虽然我们在这里,但为了使Magento功能齐全(和安全),必须设置的总权限是多少?

我意识到Magento!= Wordpress.它与Wordpress一样安装友好.只要多一点点!

rob*_*ens 18

我使用以下脚本,并不时运行它.

在将来,我将添加chown -R root.www-pub到最后,将所有必须修改代码的用户添加到www-pub组,并将umask设置为0002.同时,下面的脚本效果很好.

#!/bin/bash

if [ ! -f ./app/etc/local.xml ]; then
    echo "-- ERROR"
    echo "-- This doesn't look like a Magento install.  Please make sure"
    echo "-- that you are running this from the Magento main doc root dir"
    exit
fi

if [ `id -u` != 0 ]; then
    echo "-- ERROR"
    echo "-- This script should be run as root so that file ownership"
    echo "-- changes can be set correctly"
    exit
fi

find . -type f \-exec chmod 644 {} \;
find . -type d \-exec chmod 755 {} \;
find ./var -type d \-exec chmod 777 {} \;
find ./var -type f \-exec chmod 666 {} \;
find ./media -type d \-exec chmod 777 {} \;
find ./media -type f \-exec chmod 666 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
Run Code Online (Sandbox Code Playgroud)


Zac*_*ler 9

如果您在开发环境中,这是要走的路:

chmod -R 777 /magento-directory/
Run Code Online (Sandbox Code Playgroud)

否则这应该做:

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
Run Code Online (Sandbox Code Playgroud)

第一行将找到文件夹并将它们chmod到755.第二行查找文件并将它们chmod到644.

更多来自Magento wiki的文章.