加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

WordPress,nginx,php-fpm:XML-RPC无效

发布时间:2020-12-13 21:13:10 所属栏目:Nginx 来源:网络整理
导读:我在https://saskia.photo上在我自己的服务器上安装了带有Nginx和PHP-FPM的Wordpress 安装工作很好,但XML-RPC(由Jetpack和手机应用程序使用)会引发以下错误: 您可以通过运行自己查看错误 curl -A "Jetpack by WordPress.com" -is -H 'Content-Type: text/xm

我在https://saskia.photo上在我自己的服务器上安装了带有Nginx和PHP-FPM的Wordpress

安装工作很好,但XML-RPC(由Jetpack和手机应用程序使用)会引发以下错误:

您可以通过运行自己查看错误

curl -A "Jetpack by WordPress.com" -is -H 'Content-Type: text/xml' --data '

我已经完成了Jetpack’s troubleshooting page但没有运气.

返回的XML错误导致我推测客户端请求XML在nginx和PHP之间的某处被破坏,因此无法解析它.

这是我的nginx配置文件

server {
  listen      80;
  listen      [::]:80;
  server_name saskia.photo;
  rewrite     ^   https://$server_name$request_uri? permanent;
}

server {
  listen                443 ssl http2;
  listen                [::]:443 ssl http2;
  server_name           saskia.photo;
  ssl_certificate       /etc/letsencrypt/live/saskia.photo/fullchain.pem;
  ssl_certificate_key   /etc/letsencrypt/live/saskia.photo/privkey.pem;

  root                  /srv/wordpress/;
  charset               utf-8;

  client_max_body_size 64M;

  # Deny access to any files with a .php extension in the uploads directory
  location ~* /(?:uploads|files)/.*.php${
    deny all;
  }

  location / {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
  }

  location ~* .(gif|jpg|jpeg|png|css|js)${
    expires max;
  }

  location ~ .php${
    try_files $uri =404;
    fastcgi_split_path_info ^(.+.php)(/.+)$;
    fastcgi_index index.php;
    fastcgi_pass  unix:/var/run/php/wordpress.sock;
    fastcgi_param   SCRIPT_FILENAME
      $document_root$fastcgi_script_name;
    include       fastcgi_params;
  }
}

有没有人看到这样的问题或者我的配置文件中发现了问题?

最佳答案
似乎没有安装扩展php-xml和php-xmlrpc.

安装它们:

apt-get install php-xml php-xmlrpc

或(CentOS,RHEL等..)

yum install php-xml php-xmlrpc

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读