简体   繁体   中英

Joomla extensions, file permissions

I am having a lot of trouble installing extensions in Joomla, after looking into it a bit, I realise that I think I need to change my files permissions, I have no idea how to do this. In Joomla, System Information, Directory Permissions, all my permissions are set to unwritable apart from "configuration.php". I have no idea how to change this on linux. I am running Joomla 1.7.3 and Ubunutu 11.10.Can anybody shine any lightn on how to change the permissions?

Your problem is very likely to be OWNERSHIP rather than PERMISSIONS per se.

The problem is that there are two main ways to run PHP on a web server. One runs PHP as part of Apache and has these problems. The difficulty is that you put the files in place as one user, but the Apache web server accesses the files as a different user. In your case Apache/PHP created the configuration.php file so it is the owner and can write to it. Other files were put in place by you so Apache/PHP can't touch them.

There are two possible solutions:

1) Change the ownership of the Joomla files (recursively) to the user that Apache/PHP operates as.

chown -R user:group *

Where 'user' and 'group' should be replaced with the actual username and groupname that Apache operates as. Make sure you are in the root folder of your webspace before running this command.

2) Install and configure PHP to run through CGI using fast-cgi and SUExec.

If you go with the first option - things will work - but you will experience difficulties if you want to edit any files manually, eg template and css files.

Option 2 is a lot of work for the inexperienced but does away with these permissions difficulties as PHP will access the files as you.

Do you have shell access on the machine where the Joomla files are, or do you even have it running on your Desktop? Then it should be as easy as running the following two commands in the Joomla directory:

$ find . -type f -exec chmod 664 {} \;
$ find . -type d -exec chmod 775 {} \;

...to make all files and directories writeable for the user who owns the files and his group (and readable for all users); unless you are the user owning these files, you'll have to execute the command as root or with root rights (eg by prepending each of them with sudo ).

If you only want to allow write permissions to the user (and not the group), use 644 and 755 instead of 664 and 775 ; if you only want the user to be able to read and write them, use 600 and 700 respectively; read the chmod manual (type man chmod in the shell) for more details.

It could also be a problem with file ownership (see Dean Marshall's answer ).

Actually, configuration.php should not be writable; if you change something in the configuration from within Joomla, it should automatically be set to read-only.

If you find that you still can't install any extension, you might have to configure Joomla to use FTP for file access (which can be set up in the Joomla options). This is necessary if the user running the PHP scripts doesn't have write access to the files, but only the FTP user (such a situation might occur eg for hosted environments).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM