The problem is that I had to give sites directory and all subfolders and files of it permissions 777 in order for drupal to recognize this folder and not redirect me to install.php page. But on a virtual hosting I noticed that sites is a protected folder and all of its content esspecially sites/default/settings.php with 550 permissions. I did not get the magic trick here, how does drupal recognized that folders. I have created drupal's folders and files both as root and other sudo users, but it did not help. And drupal still see only sites with 777 permissions.

  • 2
    There's a lot of text in there that has nothing to do with the actual question. Could you please clean the question up a bit?
    – Letharion
    Nov 2, 2012 at 16:19
  • I've done what you asked for Nov 4, 2012 at 21:29

2 Answers 2


You need to insure that the php process (web server) is a member of the group for the Drupal files. You should make sure that the owner of the files is some user other than the php process / web server, because you do not want to allow the web server to overwrite the Drupal code files.

To change the group of all of the files in your root:

sudo chgrp -R webgroup /path/to/drupal

To add a group to the web server user:

sudo usermod -a -G webgroup www-data

For more advice on correctly setting file permissions for Drupal, see Securing File Permissions and Ownership.

Edit: It was suggested that this answer be expanded to point out that the above page contains a script for setting your permissions. There is also a Drush command for setting permissions in progress at http://drupal.org/node/990812. Both of these scripts can be helpful, but only if you set the user and group ownership of your files correctly, and insure that the web server user is a member of the applicable group as explained above. Please read the quoted page carefully, as it explains these concepts.


try this just replace "USER" with your login name without the Quotations this should solve all permission problems

cd /var/www
sudo chown -R "USER":www-data .
sudo chmod -R 750 .
find . -type d -wholename "*/sites/*/files" -exec sudo chmod -R 770 {} \;
sudo chmod g+s .
find . -type d -exec sudo chmod g+s {} \;

this will set all the permissions as suggested by drupal if the problem still persists then the problem isnt with permissions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.