Wordpress wp_remote_post() gives “cURL error 6: Co

2020-02-01 17:59发布

问题:

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.