How to remove CURL time limit in PHP?

I am running a rather long script that extracts the contents of the specified domain and parses html before running a series of tests on the specified html. In any case, the script expires after a while. I tried putting this at the top of my page, but still no luck:

set_time_limit(0);

Here is the error in question:

cURL error number:28
cURL error:Operation timed out after 10000 milliseconds with 316183 out of 6476018 bytes received
+5
source share
3 answers

You need to set the time to freeze to complete your operations with curl_setopt.

The value of CURLOPT_TIMEOUT must be defined.

curl_setopt($ch, CURLOPT_TIMEOUT, 400); // the timeout in seconds

http://www.php.net/manual/en/function.curl-setopt.php

+22
source

Use option CURLOPT_TIMEOUTin conjunction with curl_setopt().

curl_setopt($curl, CURLOPT_TIMEOUT, 0); // zero waits indefinitely

set_time_limit() script. , , - cURL.

http://php.net/curl-setopt

+4
+1

All Articles