WordPress / 站点运行状况 / REST API 错误 / 环回错误

Mar*_*nde 4 wordpress openssl loopback wordpress-rest-api csf

你好吗?当我使用本机 WordPress 站点运行状况功能时,我收到两个错误。

Your site could not complete a loopback request

Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.

The loopback request to your site failed, this means features relying on them are not currently working as expected.

Error: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to mydomain.com:443 (http_request_failed)
Run Code Online (Sandbox Code Playgroud)

The REST API encountered an error

The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.

The REST API request failed due to an error.
Error: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to mydomain.com:443 (http_request_failed)
Run Code Online (Sandbox Code Playgroud)

已经做了:

  • 我禁用了所有插件。
  • 我更改为默认主题。
  • 我在 whm 上禁用了 CSF 和 ModSecurity。

但没有成功。我该如何解决这个问题?

qia*_*lei 6

在我本地的开发环境中,我遇到了同样的两个关键问题。

我的 WordPress 站点默认地址为“http://localhost:8000”,在本地 docker 容器中运行,将 extra_hosts 部分添加到 docker-compose.yml 后,问题解决了。

这是工作中的 docker-compose.yml

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress
   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_DB_NAME: wordpress
     extra_hosts:
       - "localhost:172.18.0.1"
volumes:
    db_data: {}
Run Code Online (Sandbox Code Playgroud)

请注意,172.18.0.1 是默认的 docker 网关。