• 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 on update-core.php to 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.php

    So 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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator threadi

    (@threadi)

    The access permissions for directories and files must be set in your hosting in accordance with the settings in the hosting. WordPress cannot influence this for you and unfortunately automatically suggests FTP as an alternative in such cases, which is not necessary. There is an article about this here: https://developer.wordpress.org/advanced-administration/server/file-permissions/

    I would recommend contacting your host’s support team for assistance.

    Thread Starter brabbit7

    (@brabbit7)

    I’m actually self hosting on a Debian server. I’ll reach out to them as well maybe there is something different in the packaging.

    That being said though, I do think this is a wordpress issue, I cited the wordpress documentation for best practices and those recommendations don’t seem to work for updating the wordpress. Although I suppose unless the recommended method is to just update it via FTP.

    And the wp-cli application is also not working for me either which doesn’t seem to be a permissions issue at all but some other bug.

    Moderator t-p

    (@t-p)

    Try Manually upgrading. When all else fails, download a fresh copy of the WordPress (top right on this page) to your computer, and use that to copy up. Access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), and delete then replace the wp-admin and wp-includes folders on your server (NOTE: do not delete the wp-content directory or your wp-config.php file). Read the Manual Update directions first.

    BACKUP: If you haven’t already done, always backup everything (including your database) before doing any actions, just in case something really goes wrong. You can never have enough backups! See https://wordpress.org/support/article/wordpress-backups/

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cannot Upgrade WordPress’ is closed to new replies.