php cURL多响应错误500

时间:2016-12-11 21:23:28

标签: php curl

当我第二次运行代码时,响应500错误:

  尝试使用ErrorDocument处理请求时遇到了

500内部服务器错误错误。

如何解决? 我的代码:

    $ch1 = curl_init();
    $ch2 = curl_init();

    // set URL and other appropriate options
    $headers['Content-Type'] = 'text/html';

    curl_setopt($ch1, CURLOPT_URL, "http://nhuyexpress.com.vn/view-order/?matracuu=1ZY10Y950301862805");
    curl_setopt($ch1, CURLOPT_HEADER, 0);

    curl_setopt($ch2, CURLOPT_URL, "http://nhuyexpress.com.vn/view-order/?matracuu=1ZY10Y950301862805");
    curl_setopt($ch2, CURLOPT_HEADER, 0);
    //create the multiple cURL handle
    $mh = curl_multi_init();

    //add the two handles
    curl_multi_add_handle($mh,$ch1);
    curl_multi_add_handle($mh,$ch2);

    $running = null;
    do {
        curl_multi_exec($mh, $running);
    } while($running > 0);

    //close the handles
    curl_multi_remove_handle($mh, $ch1);
    curl_multi_remove_handle($mh, $ch2);
    curl_multi_close($mh);

我收到的回复

enter image description here

0 个答案:

没有答案