php curl_exec returns empty

前端 未结 4 922
刺人心
刺人心 2020-12-16 15:08
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_PROXY, $proxy); // $proxy is ip of          


        
4条回答
  •  北海茫月
    2020-12-16 16:09

    Try:

    curl_setopt($ch, CURLOPT_TIMEOUT, 50);
    

    Maybe the response is longer than 10.

    I had the same issue, I solved like this.

提交回复
热议问题