Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to update to WordPress 4.7.2 - Error: inconsistent file permissions

I keep getting this error message when I try to automatically update WordPress to 4.7.2 through the admin:

Update WordPress Downloading update from https://downloads.wordpress.org/release/wordpress-4.7.2-new-bundled.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

I tried running the following commands from this article on my server and I am still getting an error message:

sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +
sudo chmod 660 wp-config.php

What am I doing wrong? Shouldn't the automatic update work with the correct file/folder permissions?

like image 720
Liz Avatar asked Feb 01 '17 23:02

Liz


2 Answers

Have you tried manually uploading the updated WordPress files, via a programme such as FTP (Filezilla)? Do you still get the same problem?

Update:

Run the following

Reset the permissions of all files to 664:

find /path/to/site/ -type f -exec chmod 664 {} \;

Reset permissions of directories to 775:

find /path/to/site/ -type d -exec chmod 775 {} \;

Reset the group to the wordpress group (or whatever group makes sense for you)

chgrp -R wordpress /path/to/site/
like image 74
Craig Avatar answered Sep 18 '22 17:09

Craig


For me, the command below worked. In the example below, replace "www-data" with the name of user under which the web server service runs. Also replace "/path/to/site" with the actual path to the root of your WP site.

chown -R www-data:www-data /path/to/site

IMPORTANT Be sure to revert this afterwards by granting ownership back to a regular user (not the web service user) otherwise it will not be secure at all. Also, leave the web service user as owner of the wp-content/uploads folder so that users can upload media.

chown -R user:group /path/to/site
chown -R www-data:www-data /path/to/site/wp-content/uploads
like image 24
blizz Avatar answered Sep 17 '22 17:09

blizz