Drupal automatically changes the directory permissions of sites/default to 555 (i.e. read-only), which means that if I'm editing sites/default/settings.php, even if I've set the permissions for that file to read/write (which it again reverts on a page load), PhpStorm still gives me a permission denied error on the swap file it's attempting to create in the same directory.

  • Is there a more flexible way to update settings (especially on a dev machine) other than manually setting the file and directory permissions every time you need to edit those files?
  • Do I just have to do it via sudo?
  • Can I disable permissions checking for a specific environment?

2 Answers 2


If you are on Drupal 8, you can configure settings.php to include a settings.local.php with a simple environment check (to ensure you are running a local env).

In that file, you can add this:

$settings['skip_permissions_hardening'] = TRUE;

This will allow you to open and write to settings.php without it being locked back down.

  • Thanks - I'll add that this is included in the default settings of example.settings.local.php Feb 5, 2017 at 15:19
  • along with this, I needed to make sure the owner was myself. example: sudo chown -R username rootdir Feb 18, 2020 at 22:43

Filezilla allowed me to change the permissions from the the Filezilla console when cpanel could not Drupal Docs

  • This isn't a question about cpanel permissions. Feb 18, 2020 at 22:38

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.