Mthe beseti
Mthe beseti

Reputation: 619

Make files writable for magento in linux

I'm new to magento and linux. When install Magento on my localhost. i get the following warnnings:

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.

I did some research but i do not know which file path or directory i should change. thank you

Upvotes: 0

Views: 2405

Answers (2)

roberttstephens
roberttstephens

Reputation: 443

I would recommend the script at What permissions are needed to run Magento?

For completeness, it's pasted below.

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

Upvotes: 1

Emi
Emi

Reputation: 1018

Change the owner of those folders (all 3 of them, an example just for changing the owner for the last folder - media) to www-data or change their mode to 777.

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

Upvotes: 1

Related Questions