简体   繁体   中英

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. I set max_execution_time Limit to 900. So why this Request Timeout happen. Is that server problem or php.ini problem.

NOTE: My Proxy is Working and its high speed. I send data in loop. So after 1mint this error show. in title say 500 Internal server error and in body says 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

curl_setopt($ch, CURLOPT_TIMEOUT, 10);

to 900 seconds, like this:

curl_setopt($ch, CURLOPT_TIMEOUT, 900);

These numbers are seconds (not 100% sure). Also find according curl documentation here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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