Trouble with upgrading to 5.6.2.1 - newbie

Permalink 1 user found helpful
Hello, I wonder if anyone can help me with upgrading advice. I have upgraded before with no problems and am currently running C5 5.6.1.2.

I've backed up my website using Filezilla, all fine, and when I click "update database" I see an error message:

"Unable to write to config/site.php. You must make config/site.php writable in order to upgrade in this manner."

I Googled this error message and changed the numeric value of the config folder (I think to 666 but can't remember). I tried to update again, and the error message cleared BUT I then had a screen that looked as though I was installing C5 for the first time. It was asking me to enter data and choose whether I wanted a dummy site installed with dummy data.

At this stage I didn't continue and changed the config number back to 755.

I'm very new to all this and so not sure if I've done the right thing or not. Can anyone help please?

Thanks!

 
goldhat replied on at Permalink Reply
File permission 666 is lower than 755 so when you changed that C5 could not read the file and a site without site.php is a fresh install so that's why the install screen loaded.

How permissions work can vary a bit depending on the server setup but generally 755 is writeable, sometimes 766 or 777 is required. Higher numbers mean less secure, 777 is totally open to read and write. So try 766, then try 777. If that works, remember to reset site.php to 755 after the upgrade is complete to better secure it.

Now if 777 doesn't work and you still see the not writable error, then it's not a file permission issue, instead it's an file ownership issue. As I'm not a server technical guy I can't explain it to well but bottom line is sometimes when PHP makes a file on your server it is owned by a different Apache user and can not be written or removed by the regular Apache user. You can fix it yourself if you know SSH commands and have sudo access on the server you would change file ownership using chown command. If SSH/chown mean nothing to you the alternative is contact your host, say "help this file is under a different apache owner I can't make it writable", and they will solve that for you by changing the ownership of the file.
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
There are 2 sets of permissions you need to consider, directory permissions and file permissions.

Ideal permissions are
/config/ directory 0755
/config/site.php file 0644

If your web server is set up more restrictively, you may need less restrictive permissions
/config/ directory 0777
/config/site.php file 0666

Above all else:
- Do no set file permission values on directories, as that will make the directory unusable.
- Do not set directory permission values on files, as that could open up security holes.

You don't need to change permissions in bulk, but there is also more general info in
http://www.concrete5.org/documentation/how-tos/developers/sort-out-...