Hello! I did a fresh install of Drupal 6.3, and everything works perfectly.

I would now like to make a change to settings.php, but I find that I cannot delete it nor overwrite it, even though I have set the CHMOD to 777 for the file.

Any advice would be greatly appreciated! Unless I can make this change, I am sort of stuck!

-David

Comments

alexrayu’s picture

Try using a front end ftp manager to change the access rules, and if it fails, then this may be an issue I once faced.
NAMELY, that in some cases when the server creates files in your folder from the scratch, it assigns to it it's own privileges. Which makes it unwritable (and often times undeletable) for you.
SOLUTION:
1. Contact your hosting support to fix it.
2. Place a dummy settings.php file in the distro next time you upload it to keep the system from owning it.

- Alexei Rayu.

Drupal Related Services | SiteHound 1.2 (based on Drupal 5.9) - Free Download

davedelong’s picture

Correct me if I'm wrong, but shouldn't the containing folder *also* have write privileges?

Dave

Get great Drupal hosting at MM Hosting. (I don't work for them; I'm just a very satisfied customer)

Chippe’s picture

if you give all folders and files 777 you should be able to remove them.

akael’s picture

Had the same problem on 1and1 hosting a few days ago, and I basically just gave it a day and then was able to delete the file.

xmacinfo’s picture

Drupal 6 protects the settings.php file in a much more efficient way. Trying to change the permissions through FTP did not work on Site 5.

Anyway, on Site 5 you can change the CHMOD when you enable the shell and use it. You can also use their web file manager, which is rudimentary, to change the content of the file, a solution I did use in the end.

I don't mind Drupal 6 being more secure if there are solutions and not left alone.

alexrayu’s picture

D6 in many cases creates a new settings.php file in a new folder for itself. And that my result in that problem under some circumstances.

- Alexei Rayu.

Drupal Related Services | SiteHound 1.2 (based on Drupal 5.9) - Free Download

Dokuro’s picture

The fastest way

Make a page with this code:

`chmod -R a+w path/to/file`;

replace "path/to/file" with your path to the file, ex: sites/default

That should do it for you.

Oh..important, delete that page as soon as your done!!!

alexrayu’s picture

Great and simple.

Dokuro’s picture

I think its important to note that you need not include the file name. Just the path to the file directory.

sites/default

`chmod -R a+w sites/default`;
mosrur’s picture

thanks so very much. It worked like a magic.

vertazzar’s picture

all folders above settings.php must have r-w permissions

tech108’s picture

that's the one that did it for me - changed all parent permissions

dhavalvyas’s picture

That helped me.

Changes all the parent folders permission to write..

Thanks.

chcPACT’s picture

Using Webspace Explorer in 1and1 I CHMOD'd the Default folder to 777. Deleted the file (in my case civicrm.settings.php) and reset the folder permissions to 500.

Nightcaps43’s picture

I had this issue, but noticed there are no write permissions on the sites/default folder. Same thing for the sites/default/file folder. Do a chmod 777 on these and you can erase the files inside those folders. Just spotted this in several earlier posts - sorry for the redundant info.

RocketUSA’s picture

I had the same issue with 1and1 and it's been a huge issue, always had to get tech support to delete these files for me. While I had set chmod to 777 on the files, the folder had been set to 555. Apparently the folder permissions propagate to the files? Either way, I set the containing folder to 777, now I can delete the files within (as well as the folder).

dunbi07’s picture

same hosting provider same issue and same solution. Just set 777 to all "lower" folders and then you can delete setting.php.

deanflory’s picture

I too got stuck not being able to delete or rename the settings.php file on the server. Solution: change the permissions on the Default folder or whatever the surrounding folder is titled. This worked for me when upgrading to Drupal 6.22.

nilashis’s picture

one more thing I just discovered in case others have this same problem:

"You need to add permissions to write not only the settings file but also the folder where it is."

http://drupal.org/node/821926#comment-3838210

thoughtcat’s picture

My problem is that during an import of files using Blogger Importer I accidentally created a folder to store the imported files at sites/default/files/sites. Whatever I do I can't delete the "second" sites folder or its files or subfolders. I've tried CHMODing to 777 all the files and folders from root/sites downwards but this works for every folder/file *except* the "second" sites folder and within. I guessed it might be to do with there not being a settings.php file inside the second sites/default folder, but I can't write to that folder so can't put settings files there anyway. I really want to delete this entire folder and start the Blogger import again, not least because now when I use the media browser, all the files I imported are showing up in "library" and these are not appropriate. Help!

moinakbarali’s picture

I gave the write permission to default folder and then I'm able to delete/update/rename settings file.
Thanks :)