title: How to correct Zend_Uri_Exception (YouTube API with PHP Zend Gdata)
body: <p>I am using Zend Gdata to interface with the YouTube API from a PHP script. I actually had this working fine, and suddenly I am getting a fatal error about a 'Zend_Uri_Exception' with message 'Invalid URI supplied'. How can I correct the exception?</p>
  
  <p>CODE:</p>
  
  <pre><code>require_once 'Zend/Loader.php';
  Zend_Loader::loadClass('Zend_Gdata_YouTube');
  
  $yt = new Zend_Gdata_YouTube();
  $query = $yt-&gt;newVideoQuery();
  $query-&gt;setOrderBy($this-&gt;data['ItemVideo']['sort']);
  $query-&gt;setRacy('include');
  $query-&gt;setCategory($this-&gt;data['ItemVideo']['q']);
  
  try {
    $videoFeed = $yt-&gt;getVideoFeed($query);
  } catch(Exception $e) {
    echo var_dump($query) . '&lt;p&gt;&lt;/p&gt;' . $e;
  }
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>object(Zend_Gdata_YouTube_VideoQuery)#79 (4) { ["_params:protected"]
  =&gt;  array(2) { ["orderby"]=&gt;  string(9) "relevance" ["racy"]=&gt;  string
  (7) "include" } ["_defaultFeedUri:protected"]=&gt;  NULL
  ["_url:protected"]=&gt;  NULL ["_category:protected"]=&gt;  string(14)
  "charlie bit me" }
  
  exception 'Zend_Uri_Exception' with message 'Invalid URI supplied' in /
  web/php/balistik_list_app/app/vendors/ZendGdata/library/Zend/Uri/
  Http.php:136 Stack trace: #0 /web/php/balistik_list_app/app/vendors/
  ZendGdata/library/Zend/Uri.php(123): Zend_Uri_Http-&gt;__construct
  ('http', '//gdata.youtube...') #1 /web/php/balistik_list_app/app/
  vendors/ZendGdata/library/Zend/Http/Client.php(257): Zend_Uri::factory
  ('http://gdata.yo...') #2 /web/php/balistik_list_app/app/vendors/
  ZendGdata/library/Zend/Gdata/App.php(476): Zend_Http_Client-&gt;setUri
  ('http://gdata.yo...') #3 /web/php/balistik_list_app/app/vendors/
  ZendGdata/library/Zend/Gdata.php(203): Zend_Gdata_App-
  &gt;performHttpRequest('GET', 'http://gdata.yo...', Array, NULL, NULL,
  
  NULL) #4 /web/php/balistik_list_app/app/vendors/ZendGdata/library/Zend/
  Gdata/App.php(610): Zend_Gdata-&gt;performHttpRequest('GET', 'http://
  gdata.yo...') #5 /web/php/balistik_list_app/app/vendors/ZendGdata/
  library/Zend/Gdata/App.php(541): Zend_Gdata_App-&gt;get('http://
  gdata.yo...') #6 /web/php/balistik_list_app/app/vendors/ZendGdata/
  library/Zend/Gdata/App.php(147): Zend_Gdata_App-&gt;importUrl('http://
  gdata.yo...', 'Zend_Gdata_YouT...') #7 /web/php/balistik_list_app/app/
  vendors/ZendGdata/library/Zend/Gdata.php(148): Zend_Gdata_App-&gt;getFeed
  ('http://gdata.yo...', 'Zend_Gdata_YouT...') #8 /web/php/
  balistik_list_app/app/vendors/ZendGdata/library/Zend/Gdata/YouTube.php
  (171): Zend_Gdata-&gt;getFeed('http://gdata.yo...', 'Zend_Gdata_YouT...')
  #9 /web/php/balistik_list_app/app/controllers/
  item_videos_controller.php(35): Zend_Gdata_YouTube-&gt;getVideoFeed(Object
  (Zend_Gdata_YouTube_VideoQuery)) #10 /web/php/balistik_list_app/cake/
  libs/object.php(114): ItemVideosController-&gt;search() #11 /web/php/
  balistik_list_app/cake/dispatcher.php(259): Object-&gt;dispatchMethod
  ('search', Array) #12 /web/php/balistik_list_app/cake/dispatcher.php
  (213): Dispatcher-&gt;_invoke(Object(ItemVideosController), Array) #13 /
  web/php/balistik_list_app/app/webroot/index.php(90): Dispatcher-
  &gt;dispatch(NULL) #14 {main} 
  </code></pre>