title: PHP cURL - limit execution time
body: <p>we are working with webservices but sometimes, they don't respond, they are too long to respond.</p>
  
  <p>How to stop cURL if it takes more than 1 second ?</p>
  
  <p>I tried : </p>
  
  <pre><code>curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,1);
  curl_setopt($ch, CURLOPT_TIMEOUT, 1);
  </code></pre>
  
  <p>I Also tried to create a "temporary page" between my server and the webservice : my server calls a temporary page with :</p>
  
  <pre><code>set_time_limit(1);
  ini_set('max_execution_time', 1);
  </code></pre>
  
  <p>And this temporary page calls the webservice itself with curl, but still nothing. If my webservice has a time execution of 10 seconds, i'll have to wait 10 seconds.</p>
  
  <p>Any ideas ?</p>