title: SFTP not supported error with PHP & cURL
body: <p>I followed the advice from <a href="https://stackoverflow.com/questions/717854/sftp-from-within-php">this Stack Overflow question thread</a>, but I keep hitting a snag.</p>
  
  <p>I am receiving the following error message:  Unsupported protocol: sftp</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$ch = curl_init();
  if(!$ch)
  {
      $error = curl_error($ch);
      die("cURL session could not be initiated.  ERROR: $error."");
  }
  
  
  $fp = fopen($docname, 'r');
  if(!$fp)
  {
      $error = curl_error($ch);
      die("$docname could not be read.");
  }
  
  curl_setopt($ch, CURLOPT_URL, "sftp://$user_name:$user_pass@$server:22/$docname");
  curl_setopt($ch, CURLOPT_UPLOAD, 1);
  curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP);
  curl_setopt($ch, CURLOPT_INFILE, $fp);
  curl_setopt($ch, CURLOPT_INFILESIZE, filesize($docname));
  
  //this is where I get the failure
  $exec = curl_exec ($ch);
  if(!$exec)
  {
      $error = curl_error($ch);
      die("File $docname could not be uploaded.  ERROR: $error.");
  }
  
  curl_close ($ch);
  </code></pre>
  
  <p>I used the curl_version() function to see my curl information, and found that sftp doesn't seem to be in the array of supported protocols:</p>
  
  <pre><code>[version_number] =&gt; 462597
      [age] =&gt; 2
      [features] =&gt; 1597
      [ssl_version_number] =&gt; 0
      [version] =&gt; 7.15.5
      [host] =&gt; x86_64-redhat-linux-gnu
      [ssl_version] =&gt;  OpenSSL/0.9.8b
      [libz_version] =&gt; 1.2.3
      [protocols] =&gt; Array
          (
              [0] =&gt; tftp
              [1] =&gt; ftp
              [2] =&gt; telnet
              [3] =&gt; dict
              [4] =&gt; ldap
              [5] =&gt; http
              [6] =&gt; file
              [7] =&gt; https
              [8] =&gt; ftps
          )
  </code></pre>
  
  <p>Is this a matter of my version of cURL being outdated, or is the SFTP protocol simply not supported at all?</p>
  
  <p>Any advice is greatly appreciated.</p>