MAMP 上的 WordPress 需要 WebFTP 进行更新。我在哪里可以找到这个?

WordPress on MAMP wants WebFTP for updates. Where can I find this?

我已经使用 MAMP 在我的本地计算机上安装了 WordPress。 如果我想更新系统或插件,WordPress 每次都会要求提供 WebFTP 凭据。我已经在 localhost 和 localost:8888 上尝试过 root/root。都错了?

我在哪里可以 find/set 这些凭据? 或者有什么办法可以防止WP询问?

这个问题对我来说是新的。过去不需要 WebFTP 凭证?!

我一直告诉 WordPress 直接编辑文件来更新 WordPress,而不是使用 FTP。为此,请将 define('FS_METHOD', 'direct'); 添加到您的 wp-config.php 文件,然后确保这些文件归运行 Apache 的用户所有。我认为默认情况下,MAMP 的免费版本会像您一样运行,因此您不需要对文件权限进行任何不同的操作。

以下是来自 WP Editing wp-config.php 文档页面的 FS_METHOD 常量的文档。

FS_METHOD forces the filesystem method. It should only be "direct", "ssh2", "ftpext", or "ftpsockets". Generally, you should only change this if you are experiencing update problems. If you change it and it doesn't help, change it back/remove it. Under most circumstances, setting it to 'ftpsockets' will work if the automatically chosen method does not. Note that your selection here has serious security implications. If you are not familiar with them, you should seek help before making a change.

**(Primary Preference) "direct"** forces it to use Direct File I/O requests from within PHP. It is the option chosen by default.
**(Secondary Preference) "ssh2"** is to force the usage of the SSH PHP Extension if installed
**(3rd Preference) "ftpext"** is to force the usage of the FTP PHP Extension for FTP Access, and finally
**(4th Preference) "ftpsockets"** utilises the PHP Sockets Class for FTP Access.