title: cURL not working correct!
body: <p>I have a question about cURL. I am using cURL with this function:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  </code></pre>
  
  <p>Only this was causing an error: "Message: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set"</p>
  
  <p>So I asked my hosting provider to fix this, and they did. But, and this is really stupid, they put a "curl" file in my bin directory. And I have no idea how to include this in my php script :S.</p>
  
  <p>Never done it before, but can anybody help me. I am really stuck. I hope I posted enough info!</p>
  
  <p>Tnx in advanced!</p>
  
  <hr>
  
  <p>Tnx for all the great replies. But How would I fit "exec()" in this code?</p>
  
  <pre><code>    // create a new cURL resource
      $ch = curl_init();
  
      // set URL and other appropriate options
      curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
      curl_setopt($ch, CURLOPT_TRANSFERTEXT, TRUE);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
      curl_setopt($ch, CURLOPT_URL, $articleUrl);
      curl_setopt($ch, CURLOPT_HEADER, 0);
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
      curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
  
      // grab URL and pass it to $grabArticle
      $grabArticle = curl_exec($ch);
  </code></pre>
  
  <hr>
  
  <p>Edit 2:
  Oké, I almost got it working :). It is working just fine when I run it in putty, but in my php script nothing happens :(</p>
  
  <p>I run this:</p>
  
  <pre><code>$grabArticle = exec('/home/twittern/bin/curl -L -m 30 -w url_effective --max-redirs 5 http://fok.nl/415758');
  echo $grabArticle;
  </code></pre>
  
  <p>Any thing I am doing wrong?</p>