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);