Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix Joomla directory permissions
10-25-2011, 08:52 AM,
#1
Fix Joomla directory permissions
Setting Joomla Directory Permissions
- updated 03/15/2012 for Joomla 2.5
- for Joomla 3.0, jump to Fix Joomla 3.0 directory permissions

After installing Joomla! 2.5 (1.5, 1.6, 1.7) you may need to fix the directory permissions in order to have Joomla! working without "permission denied" errors.

To view the list of folders that need RW (read, write) rights, go to your Joomla! Administration panel (/administrator) and access "Site" >> "System Information" and select the "Directory Permissions" tab. You will see the full list of directories with the "Writable" or "Unwritable" status. You can change the file permissions for these directories one-by-one via the cPanel File Manager, FTP or any other way. If you have SSH acces, by running the following bash script, where you need to change the "username" for SERVERUSER and optionally add the INSTALLDIR:

Code:
#!/bin/bash

SERVERUSER="username"     #username on your server (same as login name for cPanel) /home/SERVERUSER
INSTALLDIR=""            #optional, always start with "/" example: /myjoomla will point to www.your-domain.com/myjoomla directory

#change JOOMLAPATH to point to your Joomla! installation directory, the setting below works on default cPanel servers
#if SERVERUSER and INSTALLDIR is correctly set

JOOMLAPATH="/home/$SERVERUSER/public_html$INSTALLDIR"
echo "Home Directory: /home/"$SERVERUSER
echo "Joomla Install:" $JOOMLAPATH

#verify and accept before running chmod on Joomla! directories
read -p "Continue with chmod (y/n)?"
    if [ $REPLY != "y" ]; then
    echo "Exiting..."
    exit 1
    fi

chmod -v 0777 $JOOMLAPATH/administrator/components
chmod -v 0777 $JOOMLAPATH/administrator/language
chmod -v 0777 $JOOMLAPATH/administrator/language/en-GB
chmod -v 0777 $JOOMLAPATH/administrator/language/overrides
chmod -v 0777 $JOOMLAPATH/administrator/manifests/files
chmod -v 0777 $JOOMLAPATH/administrator/manifests/libraries
chmod -v 0777 $JOOMLAPATH/administrator/manifests/packages
chmod -v 0777 $JOOMLAPATH/administrator/modules
chmod -v 0777 $JOOMLAPATH/administrator/templates
chmod -v 0777 $JOOMLAPATH/components
chmod -v 0777 $JOOMLAPATH/images
chmod -v 0777 $JOOMLAPATH/images/banners
chmod -v 0777 $JOOMLAPATH/images/sampledata
chmod -v 0777 $JOOMLAPATH/images/stories
chmod -v 0777 $JOOMLAPATH/language
chmod -v 0777 $JOOMLAPATH/language/en-GB
chmod -v 0777 $JOOMLAPATH/language/overrides
chmod -v 0777 $JOOMLAPATH/libraries
chmod -v 0777 $JOOMLAPATH/media
chmod -v 0777 $JOOMLAPATH/modules
chmod -v 0777 $JOOMLAPATH/plugins
chmod -v 0777 $JOOMLAPATH/plugins/authentication
chmod -v 0777 $JOOMLAPATH/plugins/captcha
chmod -v 0777 $JOOMLAPATH/plugins/content
chmod -v 0777 $JOOMLAPATH/plugins/editors
chmod -v 0777 $JOOMLAPATH/plugins/editors-xtd
chmod -v 0777 $JOOMLAPATH/plugins/extension
chmod -v 0777 $JOOMLAPATH/plugins/finder
chmod -v 0777 $JOOMLAPATH/plugins/quickicon
chmod -v 0777 $JOOMLAPATH/plugins/search
chmod -v 0777 $JOOMLAPATH/plugins/smartsearch
chmod -v 0777 $JOOMLAPATH/plugins/system
chmod -v 0777 $JOOMLAPATH/plugins/user
chmod -v 0777 $JOOMLAPATH/templates
chmod -v 0777 $JOOMLAPATH/configuration.php
chmod -v 0777 $JOOMLAPATH/cache
chmod -v 0777 $JOOMLAPATH/administrator/cache
chmod -v 0777 $JOOMLAPATH/logs
chmod -v 0777 $JOOMLAPATH/tmp

exit 0

- as result, all directories should be "Writable":
administrator/components - Writable
administrator/language - Writable
administrator/language/en-GB - Writable
administrator/language/overrides - Writable
administrator/manifests/files - Writable
administrator/manifests/libraries - Writable
administrator/manifests/packages - Writable
administrator/modules - Writable
administrator/templates - Writable
components - Writable
images - Writable
images/banners - Writable
images/sampledata - Writable
images/stories - Writable
language - Writable
language/en-GB - Writable
language/overrides - Writable
libraries - Writable
media - Writable
modules - Writable
plugins - Writable
plugins/authentication - Writable
plugins/captcha - Writable
plugins/content - Writable
plugins/editors - Writable
plugins/editors-xtd - Writable
plugins/extension - Writable
plugins/finder - Writable
plugins/quickicon - Writable
plugins/search - Writable
plugins/smartsearch - Writable
plugins/system - Writable
plugins/user - Writable
templates - Writable
configuration.php - Writable
cache (Cache Directory) - Writable
administrator/cache (Cache Directory) - Writable
/logs (Log directory) - Writable
/tmp (Temp directory) - Writable
Reply
11-17-2011, 11:58 AM,
#2
Joomla update failed: -1 - An error has occurred. Copy failed
Upgrading 1.6.5 to 1.7: http://docs.joomla.org/Upgrading_1.6.5_to_1.7

In case the Quick Update fails with "Copy failed" error
Quote:-1 - An error has occurred.
Copy failed

Return to Control Panel
you can try changing the owner of the files in order to make them writable for joomla

Here is a shell (linux) script to chown files automatically. You need to change the "username" for SERVERUSER and optionally add the INSTALLDIR:
Code:
#!/bin/bash

SERVERUSER="username"       #username on your server (same as login name for cPanel) /home/SERVERUSER
INSTALLDIR=""               #optional, always start with "/" example: /myjoomla will point to www.your-domain.com/myjoom

#change JOOMLAPATH to point to your Joomla! installation directory, the setting below works on default cPanel servers
#if SERVERUSER and INSTALLDIR is correctly set

JOOMLAPATH="/home/$SERVERUSER/public_html$INSTALLDIR"
echo "Home Directory: /home/"$SERVERUSER
echo "Joomla Install:" $JOOMLAPATH

#verify and accept before changing owner of files
read -p "Continue with chown (y/n)?"
    if [ $REPLY != "y" ]; then
        echo "Exiting..."
        exit 1
    fi

#chown files if Joomla 1.7 upgrade fails
chown -v nobody:nobody $JOOMLAPATH/LICENSE.txt
chown -v nobody:nobody $JOOMLAPATH/README.txt
chown -v nobody:nobody $JOOMLAPATH/htaccess.txt
chown -v nobody:nobody $JOOMLAPATH/index.php
chown -v nobody:nobody $JOOMLAPATH/robots.txt
chown -v nobody:nobody $JOOMLAPATH/web.config.txt
chown -v nobody:nobody $JOOMLAPATH/joomla.xml

#verify and accept before changing owner of folders
read -p "Continue with chown (y/n)?"
    if [ $REPLY != "y" ]; then
        echo "Exiting..."
        exit 1
    fi

#and directories
chown -vR nobody:nobody $JOOMLAPATH/administrator
chown -vR nobody:nobody $JOOMLAPATH/cache
chown -vR nobody:nobody $JOOMLAPATH/components
chown -vR nobody:nobody $JOOMLAPATH/images
chown -vR nobody:nobody $JOOMLAPATH/includes
chown -vR nobody:nobody $JOOMLAPATH/language
chown -vR nobody:nobody $JOOMLAPATH/libraries
chown -vR nobody:nobody $JOOMLAPATH/logs
chown -vR nobody:nobody $JOOMLAPATH/media
chown -vR nobody:nobody $JOOMLAPATH/modules
chown -vR nobody:nobody $JOOMLAPATH/plugins
chown -vR nobody:nobody $JOOMLAPATH/templates
chown -vR nobody:nobody $JOOMLAPATH/cli
chown -vR nobody:nobody $JOOMLAPATH/installation

exit 0
I love video chat!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)