How can I figure out why cURL is hanging and unresponsive?

后端 未结 4 866
滥情空心
滥情空心 2021-01-04 00:32

I am trying to track down an issue with a cURL call in PHP. It works fine in our test environment, but not in our production environment. When I try to execute the cURL fu

4条回答
  •  醉话见心
    2021-01-04 01:33

    In your php, you can set the CURLOPT_VERBOSE variable:

    curl_setopt($curl, CURLOPT_VERBOSE, TRUE);
    

    This then logs to STDERR, or to the file specified using CURLOPT_STDERR (which takes a file pointer):

    curl_setopt($curl, CURLOPT_STDERR, $fp);
    

    From the command line, you can use the following switches:

    • --verbose to report more info to the command line
    • --trace or --trace-ascii to trace to a file

    You can use --trace-time to prepend time stamps to verbose/file outputs

提交回复
热议问题