title: YouTube API implementation with SimpleXML no longer working
body: <p>I had a website that pulled videos from a user's account using a public XML feed. The feed's URL is:</p>
  
  <pre><code>https://gdata.youtube.com/feeds/api/users/USERNAME/uploads
  </code></pre>
  
  <p>Where <code>USERNAME</code> is dynamically assigned via a PHP variable. The code to hit this URL and grab the contents is:</p>
  
  <pre><code>$file = file_get_contents('https://gdata.youtube.com/feeds/api/users/'.$channel.'/uploads');
  $xml = simplexml_load_file($file);
  </code></pre>
  
  <p>However, this is now throwing a weird error:</p>
  
  <blockquote>
    <p>Warning: file_get_contents() [function.file-get-contents]: Couldn't
    resolve host name in /home/dpw/public_html/inc/modules/youtube.php on
    line 46</p>
    
    <p>Warning:
    file_get_contents(https://gdata.youtube.com/feeds/api/users/dpwrestling/uploads)
    [function.file-get-contents]: failed to open stream: operation failed
    in /home/dpw/public_html/inc/modules/youtube.php on line 46</p>
    
    <p>Warning: simplexml_load_file() [function.simplexml-load-file]: I/O
    warning : failed to load external entity "" in
    /home/dpw/public_html/inc/modules/youtube.php on line 47</p>
    
    <p>Warning: Invalid argument supplied for foreach() in
    /home/dpw/public_html/inc/modules/youtube.php on line 49</p>
  </blockquote>
  
  <p>I'm not sure what the problem is, as visiting the URL in my web browser returns the XML fine. Why is my PHP script now having trouble retrieving it?</p>
  
  <p>For the record, the <code>allow_url_fopen</code> is still enabled in my hosting environment as I checked using <code>echo ini_get('allow_url_fopen')</code>, which printed <code>1</code>.</p>