vehe vehe - 4 years ago 126
PHP Question

500 Internal server error 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

Limit to 900. So why this Request Timeout happen. Is that server problem or

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


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download