1

I received the "The directory sites/default/files does not exist" error on a 7.43 install. In this situation, Drush is not available so I am doing a browser install.

I had this error once before in 2014 according to my notes. I don't know whether it's specific to the server I'm on or a general issue because I've done setups on other servers and don't remember seeing that particular error. In the previous situation, I noted that I changed the permissions on default to 777. I am always loathe to set much of anything to 777 so I am wondering whether it needs to be kept at 777 or is there some point after setting up the site that I can switch it to something more secure.

4
  • Have you created files folder under default during installation?
    – Manikandan
    Apr 5 '16 at 8:56
  • I did not create the files folder. I know that it will be needed for uploaded files, though. Setting the permissions on default to 777 allowed the Drupal install to create that folder. Apr 5 '16 at 14:15
  • tell me more about what are you doing this, your OS, your webserver, .... it's completely related to permission
    – Yuseferi
    Sep 8 '16 at 4:49
  • This question is from 2015 and the project is over, but the problem turned out to be a server set up error. The server admin was very responsive, but new to Linux servers, as all the other servers she manages are Windows servers. Their one Linux box had a ransomware infection, so they totally rebuilt it. The setup had some problems. Sep 9 '16 at 16:57
2

Your perms should (arguably) never be 777 on anything, but your exact situation will dictate that. 755 is often more appropriate for writeable folders, 644 for writeable files, but it depends on how your server is configured, and who owns the files.

You do need to create the sites/default/files folder manually, before the web-based installation can proceed, and your web server user must be able to write to that folder. You also need to create sites/default/settings.php, make it writeable, then remove those write perms once installation has completed. Drupal's status report will tell you about this if you haven't already done it.

There's not a lot more to it, just make sure the perms on all your files and folders are sensible for all the users that can interact with them. Securing file permissions and ownership has the full details, I'd recommended reading and fully understanding that page before going any further.

2
  • I wish I would have made more extensive notes last time. Do I understand you correctly that the Drupal install function that runs through the browser can work just fine with 755? The system admin told me that I would have to set some of the permissions to 777 and then switch them back. I will check out the resource. Apr 5 '16 at 14:19
  • You should never set 777 on anything. 755 should be the highest permission level you would set on a directory.
    – Jaypan
    Sep 8 '16 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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