curl timeout less than 1000ms always fails?

后端 未结 2 1836
萌比男神i
萌比男神i 2020-12-11 03:41

This code always fails (i.e., $result is Boolean false):

     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $path);
     cu         


        
2条回答
  •  没有蜡笔的小新
    2020-12-11 04:21

    from: http://www.php.net/manual/en/function.curl-setopt.php

    The number of milliseconds to wait while trying to connect. Use 0 to wait indefinitely. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second.

提交回复
热议问题