Cannot Upgrade WordPress
-
Hi I am having trouble updating wordpress. I am trying to update from the dashboard. When I tried to update it, it prompted me for FTP credentials. I researched this issue and found this is due to a lack of permissions, I put this line of code in my wp-config.php file so it doesn’t try to use ftp:
define('FS_METHOD', 'direct');
I was still getting permissions errors so I researched it some more and I configured my permissions as follows:
– Change ownership of all files to johndoe for the user and www-data for the group. This group contains my webserver’s account, www-data
– I set all files to 644
– I set all folders to 755
When I try to run the update from the dashboard I still get:The update cannot be installed because some files could not be copied. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php
I’m a bit confused at this point. As a test I set the permissions onupdate-core.phpto 665 and I get a new error messsage:The update cannot be installed because your site is unable to copy some files. This is usually due to inconsistent file permissions.: wp-includes/class-wp-oembed.php, wp-includes/css/dist/block-library/style-rtl.min.css, wp-includes/css/dist/block-library/style.min.css, wp-includes/css/dist/block-library/style-rtl.css, wp-includes/css/dist/block-library/style.css, wp-includes/css/dist/block-editor/style-rtl.min.css, wp-includes/css/dist/block-editor/style.min.css, wp-includes/css/dist/block-editor/style-rtl.css, wp-includes/css/dist/block-editor/style.css, wp-includes/ms-default-filters.php, wp-includes/class-wp-http.php, wp-includes/media.php, wp-includes/assets/script-loader-packages.php, wp-includes/assets/script-loader-packages.min.php, wp-includes/ms-functions.php, wp-includes/blocks.php, wp-includes/certificates/ca-bundle.crt, wp-includes/ID3/module.audio-video.quicktime.php, wp-includes/ID3/getid3.php, wp-includes/blocks/button/style-rtl.min.css, wp-includes/blocks/button/style.min.css, wp-includes/blocks/button/style-rtl.css, wp-includes/blocks/button/style.css, wp-includes/blocks/buttons/style-rtl.min.css, wp-includes/blocks/buttons/style.min.css, wp-includes/blocks/buttons/style-rtl.css, wp-includes/blocks/buttons/style.css, wp-includes/blocks/post-comments-form/style-rtl.min.css, wp-includes/blocks/post-comments-form/style.min.css, wp-includes/blocks/post-comments-form/style-rtl.css, wp-includes/blocks/post-comments-form/style.css, wp-includes/version.php, wp-includes/comment-template.php, wp-includes/js/wp-emoji-loader.js, wp-includes/js/underscore.min.js, wp-includes/js/dist/dom.min.js, wp-includes/js/dist/url.min.js, wp-includes/js/dist/components.js, wp-includes/js/dist/vendor/lodash.js, wp-includes/js/dist/vendor/lodash.min.js, wp-includes/js/dist/blocks.js, wp-includes/js/dist/block-library.min.js, wp-includes/js/dist/block-editor.min.js, wp-includes/js/dist/components.min.js, wp-includes/js/dist/block-editor.js, wp-includes/js/dist/block-library.js, wp-includes/js/dist/blocks.min.js, wp-includes/js/dist/dom.js, wp-includes/js/dist/url.js, wp-includes/js/underscore.js, wp-includes/js/tw-sack.js, wp-includes/js/crop/cropper.js, wp-includes/js/crop/cropper.css, wp-includes/js/crop/marqueeVert.gif, wp-includes/js/crop/marqueeHoriz.gif, wp-includes/js/twemoji.min.js, wp-includes/js/twemoji.js, wp-includes/js/wp-emoji-loader.min.js, wp-includes/js/wp-emoji-release.min.js, wp-includes/formatting.php, wp-activate.php, wp-admin/css/revisions.css, wp-admin/css/revisions-rtl.css, wp-admin/css/revisions-rtl.min.css, wp-admin/css/revisions.min.css, wp-admin/about.php, wp-admin/includes/upgrade.php, wp-admin/includes/class-wp-site-health-auto-updates.php, wp-admin/includes/revision.php, wp-admin/includes/schema.php, wp-admin/user-new.php, wp-admin/install.phpSo now I’m just really confused. The errors seem to indicate that the installer is failing to update these files. Which kinda makes sense since their permissions are 644, therefore my webserver’s www-data account only has read access. But it goes against what is recommended here: https://developer.wordpress.org/advanced-administration/security/hardening/ where it says only the user’s account should have write access to any folder except content (which I also tried to set with write permissions for the group).
I also tried bypassing all this and installing the wp-cli package, but when I run that from my wordpress root directory I get an different error:Neither /etc/wordpress/config-.php nor /etc/wordpress/config-.php could be found.
Ensure one of them exists, is readable by the webserver and contains the right password/username.I can’t find anything about these specific errors and would really appreciate any help anyone could provide with the best practices for permissions. Thank you!
The topic ‘Cannot Upgrade WordPress’ is closed to new replies.