Showing
1 changed file
with
4 additions
and
0 deletions
@@ -522,6 +522,10 @@ class WxPayApi | @@ -522,6 +522,10 @@ class WxPayApi | ||
522 | private static function postXmlCurl($xml, $url, $useCert = false, $second = 30) | 522 | private static function postXmlCurl($xml, $url, $useCert = false, $second = 30) |
523 | { | 523 | { |
524 | $ch = curl_init(); | 524 | $ch = curl_init(); |
525 | + //设置curl默认访问为IPv4 | ||
526 | + if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) { | ||
527 | + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); | ||
528 | + } | ||
525 | //设置超时 | 529 | //设置超时 |
526 | curl_setopt($ch, CURLOPT_TIMEOUT, $second); | 530 | curl_setopt($ch, CURLOPT_TIMEOUT, $second); |
527 | 531 |
-
Please register or login to post a comment