Drupal: unable to delete settings.php
7 Jul, 2009 Stephan 7 Comments

After the upgrade to Drupal 6.x I ran into the problem that the new settings.php in the sites/default folder could not be overwritten due to a file permissions problem: 550 Could not delete settings.php: Permission denied.
I changed the file permissions to read and write (644) and tried again, no go.
Turns out that the file permissions on the sites/default folder itself were set to 555, read and execute for owner/group/public. Once I changed that to 755 (write for owner) I had no problem overwriting the file.

New permissions on the
sites/default folder
The other sites I maintain are running Drupal 5 and have the permissions for the sites/default folder set to 755 so this could be a Drupal 6 thing.
Comments
nice, thanks
Thanks buddy, it helps me a lot
Brilliant thanks !
You're welcome!
Thank you so much. I'll just to add to the above, for others who run into problems like this:
I had the same problem after I deleted a few installs for my godaddy account.
It is tricky because you might not notice these the setting.php files are still there before you upload your new drupal version. But they are, and they don't get overwritten during your new upload. So you have a new drupal install, but the old settings.php. And then the site breaks.
So for godaddy there is a button which looks like a folder with a lock. There you can set the permissions. Make sure you check "write" permissions of the folder. Then you can delete it.
Again, thanks for saving me more headache. I actually wasted a few hours with this issue. LOL.
And now I will click on the link from the Delicious feed below: "Unborn C-section Baby Grabs Doctor's Finger From the Womd"
Yup...It looks like a mash-up between Alien and Cliffhanger......
LOL
Yes, believing you copied a new version is also a problem. Been there. :)
And yes, the photo does have a sinister aspect to it perhaps but I've been there too, I thought it was an amazing photo. :) Just for the sake of reference (given the volatile nature of the internet):