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?
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/
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With