Authored by xiaowei

wechat-curl配置变更

@@ -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