dongya4335
2019-03-08 03:23
浏览 217
已采纳

Wordpress XML-RPC POST返回32700错误,安装了php-xml扩展

I am using HTTPie to do a POST request to my local Wordpress installation with the aim of checking if XML-RPC is available and enabled.

http --verify=no POST https://crmpicco.localhost/xmlrpc.php data="<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>admin</value></param><param><value>pass</value></param></params></methodCall>"

This returns a 200, however the response has a faultCode:

HTTP/1.1 200 OK
Connection: close
Content-Length: 403
Content-Type: text/xml; charset=UTF-8
Date: Fri, 08 Mar 2019 03:18:43 GMT
Server: Apache/2.4.35 (Unix) OpenSSL/1.0.2p PHP/7.2.11
X-Powered-By: PHP/7.2.11

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><int>-32700</int></value>
        </member>
        <member>
          <name>faultString</name>
          <value><string>parse error. not well formed</string></value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

Others with this issue point to having the php-xml extension unavailable, however when I do a php -m | grep -i xml it is showing as installed:

libxml
SimpleXML
xml
xmlreader
xmlrpc
xmlwriter

What am I missing?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dqjgf0982 2019-03-11 03:39
    已采纳

    I had to fallback to using cURL for this. I'm unsure as to what exactly I was doing wrong with HTTPie or if it has a limitation in this regard, however it worked with cURL with:

    curl -k -d '<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>user</value></param><param><value>pass</value></param></params></methodCall>' https://crmpicco.localhost/xmlrpc.php

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题