2013-07-23 28 views
0

我是新的magento和Linux。當我的本地主機上安裝Magento。我得到以下warnnings:使文件可寫在Linux中的magento

Path "/var/www/magic-of-motoring/app/etc" must be writable. 
Path "/var/www/magic-of-motoring/var" must be writable. 
Path "/var/www/magic-of-motoring/media" must be writable. 

我做了一些研究,但我不知道哪個文件路徑或目錄我應該改變。 謝謝

+0

可能重複[需要什麼權限運行的Magento?](http://stackoverflow.com/questions/9244596/what-permissions-are-needed-to-run-magento) – roberttstephens

回答

1

更改這些文件夾的所有者(他們的所有3個,只是改變了最後一個文件夾所有者的例子 - 媒體)到www數據或者改變其模式爲777

chown www-data:www-data -R /var/www/magic-of-motoring/media

1

我會推薦腳本在What permissions are needed to run Magento?

爲了完整性,它被粘貼在下面。的

#!/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