PHP CURL传输文件:55,发送失败:连接被重置
我的代码:PHP CURL传输文件:55,发送失败:连接被重置,php,curl,Php,Curl,我的代码: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://site/index.php?1c.upload&filename=' . $filename); curl_setopt($curl, CURLOPT_COOKIE, $cookie); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://site/index.php?1c.upload&filename=' . $filename);
curl_setopt($curl, CURLOPT_COOKIE, $cookie);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $files); //Array CURLFile
echo $out = curl_exec($curl);
当我尝试发送文件10Mb时-全部正确。
当我尝试发送~200Mb的文件时-出现错误
55,发送失败:连接已重置
或
56,Recv故障:连接已重置
我正在尝试编写curl\u setopt($curl,CURLOPT\u HTTPHEADER,['Expect:'])代码>
不是结果。。。
然后尝试curl\u setopt($curl,CURLOPT\u TIMEOUT,3600)代码>-相同
在php.ini中:
max_execution_time = 3600
max_input_time = 3600
upload_max_filesize = 500M
post_max_size = 500M
相同的尝试<代码>设置时间限制(3600)代码>在php文件中。。。但不是结果
返回数组:
[url] => myurl
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 306
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 29.328
[namelookup_time] => 0.016
[connect_time] => 0.031
[pretransfer_time] => 0.031
[size_upload] => 116490450
[size_download] => 0
[speed_download] => 0
[speed_upload] => 3971987
[download_content_length] => -1
[upload_content_length] => 175979724
[starttransfer_time] => 1.045
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => serverIP
[certinfo] => Array
(
)
[primary_port] => 80
[local_ip] => 192.168.0.45
[local_port] => 1854
问题解决了!
需要更改Nginx配置:
client_max_body_size
问题解决了!
需要更改Nginx配置:
client_max_body_size
上载文件时出现连接问题。这种情况经常发生在互联网连接不好的情况下。我不认为……你在上传文件时遇到了连接问题。当网络连接不好时,这种情况经常发生。我不认为。。。