Solution:
This error usually happens the Web Server’s user (www-data in Apache, for example) doesn’t have the right permissions over the files that is trying to modify.
You can solve this issue by granting the right permissions to the Web Server’s user.
Run the following commands ONLY if all files within your wordpress directory are supposed to be PUBLICLY available, and you have clear what your Web Sever’s user and group are.
Running ls -l
from your WordPress root directory will show you the current ownership state.
These commands can’t be undone, and can break your site if used incorrectly. You need to know what you are doing.
chown -R <web_server_user>:<web_server_user_group> <wordpress_root_folder_path>
If you suspect that your directories and files permissions might be incorrect, you can also run:
find <wordpress_root_folder_path>/ -type d -exec chmod 0755 {} \;
find <wordpress_root_folder_path>/ -type f -exec chmod 0644 {} \;