Wordpress wp_remote_post() gives “cURL error 6: Could not resolve host”

人走茶凉 提交于 2019-12-17 16:53:36

问题


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":[]}

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?

All tips are welcome!


回答1:


as mentioned here and due to this USN:

you will may need to update your dist

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

this fixed my issue with curl


Update

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.



来源:https://stackoverflow.com/questions/42956679/wordpress-wp-remote-post-gives-curl-error-6-could-not-resolve-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!