By wpanssi on
What are the right file permissions for Drupal installation?
I am aware that you have to take out write permissions from settings.php.
But what about other files and directories?
For example themes directory? My permissions for that are: wxr-xr-x
Is that ok?
How do I check that all the permissions are right?
Thanks in advance!
Comments
settings.php needs to be
settings.php needs to be writeable on installation. Set to read only afterwards.
Other than that, your sites/default/files folder needs to be writeable.
All other folders can be left as is.
I learned it the hard way
I learned it the hard way today and I want to share my newly acquired wisdom with you… OK, this was Drupal 6.14, but I suppose all other versions work the same. And I have root access to the server -- if you don't have, you may want to create a PHP file which execs some shell commands.
Start with navigating to your site's root (where the index.php sits). Issue
chmod -R 644 *This will set all of your files to no execute, no write (except owner). Nothing will work at this time, so better don't touch Drupal by now. Next, you have to set all directories (and that's quite a bunch) to 755. Instead of long winded PHP you can issue
chmod -R "-X" *at the root level and *IX will automagically touch only directories. Heck, you're mostly done by now… One last thing remains: change to the directory where you put the 'files' folder and issue
chmod 777 filesVoilá. That's it. Hope it helps.
Norbert
-- form follows function