cURL timeout

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I have a serious problem with a script using cURL to access a site
using various different proxies. It appears that the PHP script always
stops executing if the connection to the proxy fails. I have tried
everything from setting the CURLOPT_CONNECTTIMEOUT to 30 seconds, or
even to 0 (unlimited). Same with CURLOPT_TIMEOUT.

What I want is that the PHP script continues to run (skip the proxy or
whatever). It simply doesn't work. Thanks in advance for any help!


PS: The curl options I use are:

    curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookiejar-$randnum");
    curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookiejar-$randnum");
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows
NT 5.1; en-US; rv: Gecko/20061204 Firefox/");
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_PROXY,"http://".$proxy['ip'].":".

    curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,$postfields);
    curl_setopt($ch, CURLOPT_REFERER, ...);
    curl_setopt($ch, CURLOPT_URL, ...);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,15);
    curl_setopt($ch, CURLOPT_TIMEOUT,30);

Site Timeline