wiki:faq/drupal/sftp-permission-denied

Version 5 (modified by Jamie McClelland, 9 years ago) (diff)

--

How can I upload a file to my themes or modules directory? When I try I get an access denied message

If your Drupal installation was installed by May First/People Link, then you are using a central, shared version of the Drupal code (which means that when we update the code to fix security holes, your version is automatically updated too).

One of the side effects of this setup is that you cannot modify files in many of your web root's directories (most noticeably your themes or modules directories). When you try, you will get an Access denied message.

This restriction prevents you from editing the core Drupal code (if you could edit these files, your changes might be over-written with the next Drupal update).

Here's a typical directory listing of a May First/People Link web directory:

You should not edit any of the files here. And the modules and themes (displayed in this picture as "links" which might display in your program as regular directories) should not be used either.

Drupal has a system that allows you to make your own modification to your themes and modules directories without interfering with this core Drupal code. In your web directory, along with themes, modules, and others, there is a directory called sites.

This directory is where you should put all of your customizations. The sites directory has a sub-directory called default (it may also have one called all). You can create a modules and themes directory in either default or all. Any module or theme you place in these directories will appear in your modules and themes admin pages just as if it was placed in your main modules or themes directory.

When customizing your own theme, a common approach is to:

  • Copy a theme from the central theme directory
  • Rename it after your site (so it doesn't conflict with the original them
  • Place it in your sites/default/themes or sites/all/themes directory
  • Switch your site to use your new theme
  • Customize the theme to your liking

If you are trying to add a file or folder to your sites/default directory and getting a permission denied, please see Why can't I create a file or folder in my Drupal sites/default directory?.

Attachments (3)

Download all attachments as: .zip