Make cURL output STDERR to file (or string)

后端 未结 6 1959
醉话见心
醉话见心 2020-12-03 11:30

We\'re trying to debug some cURL errors on the server, and I would like to see the STDERR log. Currently, all we can see for our error is \"error code: 7\" and that we can\'

6条回答
  •  囚心锁ツ
    2020-12-03 12:16

    You should put

    $output = fread($curl_log, 2048);
    echo $output; // This returns nothing!
    fclose($curl_log);
    

    after $response = curl_exec($curl); otherwise, file is closed during curl is executing.

提交回复
热议问题