• Resolved Chris

    (@cjm51213)


    Hi Folks,

    When I click, “Update to version 6.6.2” I am challenged for FTP credentials. I am confused. Isn’t the php code on my site simply going to copy file(s) from ww.wp.xz.cn? How does FTP become involved, and what are the expected credentials?

    I’m not sure what the answer is. I am already logged in as a WordPress administrator, so that should be sufficient, but it doesn’t seem to work. I get “Error: Could not connect to the server. Please verify the settings are correct.”.

    Thanks for the help,

    Chris.

    The page I need help with: [log in to see the link]

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

    (@threadi)

    This message can have 2 causes:

    • The directory and file permissions in your hosting are set incorrectly. WordPress cannot write here. Under Tools > Site Health you should also find a message if this is the case. In this case, contact your hoster’s support.
    • The FS_MODE is set incorrectly in the wp-config.php file. Look at the file via FTP and search for something that looks like define('FS_METHOD', 'direct'); – remove this.
    Thread Starter Chris

    (@cjm51213)

    Hi threadi,

    • The directory and file permissions in your hosting are set incorrectly. WordPress cannot write here. Under Tools > Site Health you should also find a message if this is the case. In this case, contact your hoster’s support.

    I find no complaints in “Tools > Site Health”. httpd runs as user “apache”. File permissions are all set appropriately and consistently over the complete site: owner apache:apache RWXR-XR-X for directories and RW-R–R– for files. All directories are labeled as SELinux context of https_sys_content_t, except wp-content which is httpd_sys_rw_content_t. These SELinux context settings permit httpd to write to wp-content and descendents and prevent writing anywhere outside of wp-content and descendents.

    • The FS_MODE is set incorrectly in the wp-config.php file. Look at the file via FTP and search for something that looks like define('FS_METHOD', 'direct'); – remove this.
    find /var/www/vhost/wp.tryx.org/ | xargs grep "FS_METHOD" 

    … found three references and zero definitions.

    Thanks for the help,

    Chris.

    Thread Starter Chris

    (@cjm51213)

    Hi threadi,

    To clarify, I’m confused. Why am I being challenged with FTP credentials, when I am already running as the local site administrator with all the authority I need and therefore don’t need additional credentials on my system, I am trying to access a “public” download and therefore I don’t need credentials on the remote system, WordPress presumably knows what it wants and how to get it, so I don’t actually need FTP at all.

    Can you clear up how this update process works and why FTP is coming into it at all?

    Thanks for the help,

    Chris.

    Moderator threadi

    (@threadi)

    As described above, there are 2 reasons why the update process may ask you to enter FTP access data:

    • The file system is not writable for WordPress because the web server user under which WordPress is running does not have sufficient permissions.
    • The FS_METHOD constant is set to exactly this behavior.

    One of the two must apply here. My guess is rather the directory permissions. As soon as SELinux is in use, the whole thing with the permissions becomes even more complicated. Unfortunately, I can’t tell you exactly what needs to be configured there as I don’t know your hosting system. The basics for the file system permissions that WordPress roughly requires are described here: https://developer.ww.wp.xz.cn/advanced-administration/server/file-permissions/

    Thread Starter Chris

    (@cjm51213)

    Hi threadi,

    As described above, there are 2 reasons why the update process may ask you to enter FTP access data:

    • The file system is not writable for WordPress because the web server user under which WordPress is running does not have sufficient permissions.
    • The FS_METHOD constant is set to exactly this behavior.

    Just to drive a wooden stake through the heart of this whole “file permissions” canard, I set everything 777 and I disabled SELinux. That makes this a wide open installation. No file system restrictions whatsoever.

    Your persistence and patience is to be admired. Update worked perfectly with no FTP intrusion. I am, frankly embarrassed. The site needing update was “objuan.tryx.org”, and I have been focusing my attention on “wp.tryx.org”. Regardless, update now works without FTP. However, with zero file permissions restrictions, “Themes –> Add New Theme” still produces “An unexpected error occurred. Something may be wrong with ww.wp.xz.cn or this server’s configuration. …” and updating plug-ins Produces: “Update failed: {“success”:true,”data”:{“update”:”plugin”,”slug”:”akismet”,”oldVersion”:”Version 5.0.1″,”newVersion”:”Version 5.3.3″,”plugin”:”akismet\/akismet.php”,”pluginName”:”Akismet Anti-Spam”}}”

    Whudda wanna bet both of these update mechanisms rely on REST API?

    Thanks for the help,

    Chris.

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

The topic ‘Updates’ is closed to new replies.