dqybeh2884 2016-08-17 12:27
浏览 179

40秒后CURL得到500错误

I set all options with timeout and set_time_limit, but it's not help. CURL get 500 error after 40 seconds. On remote server start long process and I need a wait finish. If file is small - all ok, if file is big - get 500 error after 40 seconds. This my code:

$curl = curl_init("http://example.com/index.php?page=uploads");
    curl_setopt($curl, CURLOPT_POST, 1);
    $datas = array(
        "id" => $id,
        "video" => $filename->new_file_name,
        "title" => $_POST["title"],
        "description" => $_POST["description"],
        "category" => array($_POST["category"]),
        "location" => $_POST["location"],
        "check" => $check,
        "start" => $start,
        "duration" => $duration
    );
    $data = json_encode($datas);

    $fp = fopen(dirname(__FILE__).'/errorlog.txt', 'w');
    curl_setopt($curl, CURLOPT_VERBOSE, 1);
    curl_setopt($curl, CURLOPT_STDERR, $fp);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);
    curl_setopt($curl, CURLOPT_TIMEOUT_MS, 900000);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_NOSIGNAL, 1);
    curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);
    curl_setopt($curl, curl_exec, 0);
    curl_exec($curl);
    print_r(curl_getinfo($curl));
    curl_close($curl);
  • 写回答

2条回答 默认 最新

  • doubaomao9304 2016-08-17 12:33
    关注

    A HTTP500 error indicates that there is a SEVER side error.

    Check the web server(Apache?) or application server(Php?) logs in order to be able to debug the issue.

    HTTP500 status explained: http://www.checkupdown.com/status/E500.html

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题