PHP Curl Slowness

前端 未结 7 1139
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 02:44

For some reason my curl call is very slow. Here is the code I used.

$postData = \"test\"
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,         


        
7条回答
  •  忘了有多久
    2021-02-04 03:05

    Curl has the ability to tell exactly how long each piece took and where the slowness is (name lookup, connect, transfer time). Use curl_getinfo (http://www.php.net/manual/en/function.curl-getinfo.php) after you run curl_exec.

    If curl is slow, it is generally not the PHP code, it's almost always network related.

提交回复
热议问题