I am unable to access certain files in the Drupal root folder. It says that I do not have the appropriate privileges to access.

Like any drupal user, I need to sometimes go in and manually delete or edit files within the root folder, specifically modules. At times, I also need to restore the files by deleting the old ones and pasting the new ones.

Before I contact server manager, is this something Drupal is causing (changing the file privileges), or is it most likely my servers fault?

Comments

nevets’s picture

Modules should not be in the root folder so I wonder what you are doing. Contributed modules should be under sites/all/modules.

As for permissions, are you using FTP or SHH to access the files?

dev25’s picture

Sorry, I thought root encompassed all files, they are not directly under the root, but in sites/all/modules. However, same issue for some files directly in the root.

I am using SHH.

nevets’s picture

How are you installing the modules originally?

dev25’s picture

Directly through the "install new module" tab. I copy/paste the url.

nevets’s picture

If you are using the install tab, you should not need to remove/replace the module files by hand. In fact as you discovered, it is difficult since installing them from the tab, makes them owned by the account used by Apache which is a different account that what you would use for ftp or ssh.

dev25’s picture

Interesting, that would make sense. However, I am unable to actually remove the module folders via the drupal uninstall feature. This is why I was going into the root to delete them.

Perhaps there is an issue with my drupal installation itself?

Codeblind’s picture

In most configurations, Drupal creates and saves files as the Apache user and group. This isn't really Drupal's doing; it's just how PHP tends to work out of the box.

If you have command line access with root access, you can create a new group (like webdev, or something), add yourself to that group, recursively chgrp all files and directories to the "webdev" group, and then set the gid bit recursively on all files and folders. If you don't know what this means, you should contact your webhost and ask them how they feel about this idea.

dev25’s picture

Thank you!