When does drupal settings.php become read-only? I experienced the drupal encountered an error when I was just creating a view. Cannot see the error logs from the admin side. Thought will enable the php error reporting in settings.php and it is shown as read-only? Why does it happen? How can I find the error causing this issue?

1 Answer 1


When does drupal settings.php become read-only?

Towards the end of the installation process, when the install scripts have finished writing all they need to write to the file.

Why does it happen?

Because leaving that file writeable represents a security risk.

How can I find the error causing this issue?

It's not an error, so there's no cause to find.

  • It is a installation in local. I have edited it before as well. But once the website started showing encountered an error message, I noticed that settings.php file became read-only Dec 7, 2018 at 16:36
  • That isn't something Drupal can do, you'll have to investigate the problem as a general file system one. Maybe someone flipped the permission bits in your git repo and you updated, maybe you set the file to ready only and forgot, maybe someone got onto your computer and did it, maybe you have a virus, and so on
    – Clive
    Dec 7, 2018 at 16:39
  • Doesn't clearing the cache and similar system calls ensure the directory and file is read only?
    – Kevin
    Dec 7, 2018 at 17:05
  • I don't think so @Kevin - there's a status report item for it, which wouldn't make a lot of sense if the system just auto-corrected itself along the way
    – Clive
    Dec 7, 2018 at 17:07
  • 1
    Are you sure that's not happening after a git pull @Kevin?
    – Clive
    Dec 7, 2018 at 17:21

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