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.
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.