Can't update to 3.9, problems with rights (One click install)

April 27, 2014 8.3k views
Wordpress was installed with the 1 click install with CentOS In wp-admin: Downloading update from https://downloads.wordpress.org/release/wordpress-3.9.zip… Unpacking the update… The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php Installation Failed In my apache2 error.log: PHP Warning: copy(/home/wordpress/public_html/wp-admin/includes/update-core.php): failed to open stream: Permission denied in /home/wordpress/public_html/wp-admin/includes/class-wp-filesystem-direct.php on line 217 Anyone knows what to do? Thanks
4 Answers
Ok, what you'll need to do is login to your server with ssh and use these commands:

cd /home/wordpress
chmod -R 755 public_html

Then try updating wordpress again if that doesn't work use the commands again but with the permission 777 after you update wordpress set the permissions back to 755. Hope this helps!
It worked! Thanks

However the problem with -R is that it touched the files also, which should be set to 644 for best security I believe.

Here's a script I found that will fix that

It doesn't let you set what permissions, but if you specific a folder, then choose for folders, it will change only the folders to 755 (as they should) and if you specify only the files, it will change only the files to 644 (as they should)

Quite handy
Hmm, somewhat annoying as it seems to have broken plugin installation/uninstallation, but that's not a huge problem, I can just do what you suggested when I need it. I'll look into it

I got the Inconsistent file error as well, this post came up for me trying to fix the issue in May 2016, so I though this might help someone else. I had to follow this:


More specifically, I had to reset the group for wordpress:

chgrp -R wordpress /path/to/site/

But first, so I wouldn't actually change anything, and just reset the group - I queried the current group of the files with

stat /path/to/file
Have another answer? Share your knowledge.