开发者

getaddrinfo: No such host is known

开发者 https://www.devze.com 2023-03-21 23:44 出处:网络
I am trying to setup a wordpress xml-rpc with rails: blog = XMLRPC::Client.new(\"localhost/blog\", \"/xmlrpc.php\", 80)

I am trying to setup a wordpress xml-rpc with rails:

blog = XMLRPC::Client.new("localhost/blog", "/xmlrpc.php", 80)

However, when I try to call something like

connection.call(
          'wp.getCommentCount',
          1,
          'username',
          'password',
          1

I get the following error:

getaddrinfo: No such host is known. 

This only happens in my localhost (I'm using xampp), on the live website it works fine. What can this be?

If I go directly to loc开发者_如何学编程alhost/blog/xmlrpc.php I get XML-RPC server accepts POST requests only. which means it's working fine. I don't understand what can be messing this up... thanks for any help.


Instead, try

blog = XMLRPC::Client.new("localhost", "/blog/xmlrpc.php", 80)

I have this tested on my WordPress site and it works for me.


Try putting "http://localhost/blog" and not "localhost/blog".

0

精彩评论

暂无评论...
验证码 换一张
取 消