在容器内更新 Wordpress。无 FTP 访问权限

Updating Wordpress inside a container. No FTP access

我用 wordpress Docker 图像安装了一个 Wordpress 网站,然后安装了我的主题。一切正常,但是当我稍后想更新 Wordpress 时,我收到这条消息:

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Wordpress 容器不是 运行 网络根目录上的 FTP 服务器。我该如何解决这个问题?

PS: 我的网站根目录在一个数据容器中,在不同的容器之间共享。

PS2: 我打算在同一个主机上存储多个 Wordpress 网站。是否还有与此兼容的解决方案?

关键是要确保您的 Web 服务器是 WordPress 安装目录(及其子目录)的所有者。您看到一个错误,因为您的网络服务器没有适当的权限来写入您的目录。

我推荐 运行 和 chown -R user:group /path/to/wordpress,用您的服务器信息替换 usergroup