简体   繁体   English

500内部服务器错误-请求超时CURL PHP

[英]500 Internal server error - Request Timeout CURL PHP

Hello I need some into about this error. 您好,我需要一些有关此错误的信息。 I send loop data using curl that data take too much time to send. 我使用curl发送循环数据,该数据花费太多时间发送。 I set max_execution_time Limit to 900. So why this Request Timeout happen. 我将max_execution_time限制设置为900。为什么会发生此请求超时。 Is that server problem or php.ini problem. 是服务器问题还是php.ini问题。

NOTE: My Proxy is Working and its high speed. 注意:我的代理正在工作,并且运行速度很高。 I send data in loop. 我循环发送数据。 So after 1mint this error show. 因此,在1分钟后显示此错误。 in title say 500 Internal server error and in body says Request Timeout 标题中说500 Internal server error ,正文中说Request Timeout

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_USERAGENT,'Opera/9.80 (Series 60; Opera Mini/6.5.27309/34.1445; U; en) Presto/2.8.119 Version/11.10');
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

echo  $data = curl_exec($ch);

curl_close($ch);

You might change your curl timeout from 10 seconds (like you have it inside your code right now) from 您可以将卷曲超时从10秒(例如现在将其包含在代码中)更改为

curl_setopt($ch, CURLOPT_TIMEOUT, 10);

to 900 seconds, like this: 到900秒,如下所示:

curl_setopt($ch, CURLOPT_TIMEOUT, 900);

These numbers are seconds (not 100% sure). 这些数字是秒(不确定100%)。 Also find according curl documentation here . 也可以在此处找到有关curl的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM