Reason:
If the Ipv6,curl is turned on by default, the IPV6 will be resolved first, and if the corresponding domain name is not IPv6, it will wait for IPV6 DNS resolution to fail to find IPv4 in accordance with the previous normal process. In the program I have a strict timeout limit for curl to get content, so it will cause the problem of unable to get the content.
WORKAROUND: Set default access to IPv4.
The Curl settings for PHP are as follows:
=, Curlopt_url,
, Curlopt_ Returntransfer,
( (' curlopt_ipresolve ') && (' curl_ipresolve_v4 ')
, Curlopt_ipresolve,curl_setopt (, Curlopt_connecttimeout,
curl_setopt ( , Curlopt_timeout,*3
= curl_exec ( span $ch Span>
);
Note: curl_setopt ($ch, Curlopt_ipresolve, CURL_IPRESOLVE_V4) The above settings only take effect when the version of PHP version 5.3 and later, Curl version 7.10.8 and above.
http://www.bkjia.com/PHPjc/440400.html www.bkjia.com true http://www.bkjia.com/PHPjc/440400.html techarticle Cause: If Ipv6,curl is turned on, the default priority is to resolve IPV6, if the corresponding domain name does not IPv6, will wait for IPV6 DNS resolution to fail timeout after the normal process to go before ...