title: Curl request not working on live server
body: <p>Can anybody tell me why this CURL code only works on my local server and not on live server?
  Tried on 3 different hosting and nothing works.</p>
  
  <p>Checked everything on live
  1) Curl enabled
  2) PHP version is OK
  3) Curl executes without any error but no result</p>
  
  <p>Its been 3 days and I am not able to find any solution 
  please help.</p>
  
  <p>
  
  <pre><code>error_reporting(1);
  set_time_limit(1500);
  
  $fname=time().'_myfile.flv';
  header('Content-type: video/x-flv');
  header("Content-Type: application/octet-stream");
  header("Content-Disposition: attachment; filename=\"$fname\"");
  
  define('USERAGENT', "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)");
  $url='http://v3.lscache5.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&amp;fexp=914010%2C907605&amp;algorithm=throttle-factor&amp;itag=34&amp;ip=112.0.0.0&amp;burst=40&amp;sver=3&amp;signature=D51A660BDF83B54B3584425DBE8930D5D0F805E1.B3FB21D0CAF625D36A17B558A0A653F20788B49F&amp;expire=1313503200&amp;key=yt1&amp;ipbits=8&amp;factor=1.25&amp;id=1cacd26a9913e4ec';
  
  
      $ch = curl_init() or die("Error");
      curl_setopt($ch, CURLOPT_USERAGENT, USERAGENT);
      curl_setopt($ch, CURLOPT_URL, $url);    
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);  
      if(curl_exec($ch) === FALSE) 
      {
          die("Curl failed: " . curl_error($ch));  // Never goes here
      }
  
      curl_close($ch);
  </code></pre>
  
  <p>?></p>