title: Faster alternative to file_get_contents()
body: <p>Currently I'm using file_get_contents() to submit GET data to an array of sites, but upon execution of the page I get this error:</p>
  
  <p>Fatal error: Maximum execution time of 30 seconds exceeded</p>
  
  <p>All I really want the script to do is start loading the webpage, and then leave. Each webpage may take up to 5 minutes to load fully, and I don't need it to load fully.</p>
  
  <p>Here is what I currently have:</p>
  
  <pre><code>        foreach($sites as $s) //Create one line to read from a wide array
          {
                  file_get_contents($s['url']); // Send to the shells
          }
  </code></pre>
  
  <p>EDIT: To clear any confusion, this script is being used to start scripts on other servers, that return no data.</p>
  
  <p>EDIT: I'm now attempting to use cURL to do the trick, by setting a timeout of one second to make it send the data and then stop. Here is my code:</p>
  
  <pre><code>        $ch = curl_init($s['url']); //load the urls
          curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); //Only send the data, don't wait.
          curl_exec($ch); //Execute
          curl_close($ch); //Close it off.
  </code></pre>
  
  <p>Perhaps I've set the option wrong. I'm looking through some manuals as we speak. Just giving you an update. Thank you all of you that are helping me thus far.</p>
  
  <p>EDIT: Ah, found the problem. I was using CURLOPT_CONNECTTIMEOUT instead of CURLOPT_TIMEOUT. Whoops.</p>
  
  <p>However now, the scripts aren't triggering. They each use ignore_user_abort(TRUE); so I can't understand the problem</p>
  
  <p>Hah, scratch that. Works now. Thanks a lot everyone</p>