Wordpress wp_remote_post() 给出“cURL 错误 6:无法解析主机"; [英] Wordpress wp_remote_post() gives "cURL error 6: Could not resolve host"

查看:43
本文介绍了Wordpress wp_remote_post() 给出“cURL 错误 6:无法解析主机";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从今天早上开始,我管理的 wordpress 站点中的某些功能不再起作用.我系统记录了它的响应,这给了我:

Since this morning some function in a wordpress site I'm managing is not working anymore. I syslogged the response from it, which gives me:

{"errors":{"http_request_failed":["cURL error 6: Could not resolve host: subdomain.example.com"]},"error_data":[]}

当我从那台机器手动运行 curl 时,我只是得到 html 作为响应.由于它说它无法解析主机,我认为问题发生在域名可以解析为 ip 之前.所以我猜(但不确定)这与 DNS 有关系.

When I manually run curl from that machine I simply get the html as a response. Since it says it could not resolve the host, I presume the problem occurs before the domain name can be resolved to an ip. So I guess (but not sure) this has something to do with the DNS.

我真的不明白这里可能出了什么问题,也不明白我该如何调试.有人有什么建议吗?

I really don't understand what could be wrong here or how I can debug this. Does anybody have a suggestion?

欢迎所有提示!

推荐答案

如前所述 这里由于这个USN:

您可能需要更新您的发行版

you will may need to update your dist

sudo apt-get update
sudo apt-get dist-upgrade

这解决了我的 curl 问题

this fixed my issue with curl

你需要注意dist-upgrade步骤,一些包-比如php-在升级过程中会提示你是否要替换配置文件,你必须非常清楚您在此处做什么,保留这些文件或替换为新的 -default- 文件.

you will need to be aware of the dist-upgrade step, some packages -such as php- during the updrage will prompt you to ask you wether you want to replace the configuration files , you must be very aware of what you are doing here , keeping those files or replacing with the new -default- files.

这篇关于Wordpress wp_remote_post() 给出“cURL 错误 6:无法解析主机";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆