CURL and HTTPS, “Cannot resolve host”

前端 未结 11 1981
时光取名叫无心
时光取名叫无心 2020-11-28 08:25

I\'m trying to fetch the contents of a page using CURL. The page that is doing the fetching is https and the page it is trying to fetch is also https. I\'m getting an erro

11条回答
  •  臣服心动
    2020-11-28 09:03

    I found that CURL can decide to use IPv6, in which case it tries to resolve but doesn't get an IPv6 answer (or something to that effect) and times out.

    You can try the command line switch -4 to test this out.

    In PHP, you can configure this line by setting this:

    curl_setopt($_h, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
    

提交回复
热议问题