title: Uploading files using SCP using phpseclib
body: <p>I need to create 2 functions: one to upload files using SFTP and another using SCP. I'm using <a href="http://phpseclib.sourceforge.net/" rel="nofollow">phpseclib</a> and the <code>put</code> method; I believe I have the SFTP function done.</p>
  
  <p>Now, I'm trying to do the SCP function. Per <a href="http://adomas.eu/phpseclib-for-ssh-and-scp-connections-with-php-for-managing-remote-server-and-data-exchange/" rel="nofollow">http://adomas.eu/phpseclib-for-ssh-and-scp-connections-with-php-for-managing-remote-server-and-data-exchange/</a>, it seems like the following are the things I need to do:</p>
  
  <pre><code>In case of SCP:
  1. Including the needed file: include('/path/to/needed/file/Net/SFTP.php');
  2. Creating object and making connection:
  $sftp = new Net_SFTP('host');
  if (!$sftp-&gt;login('user', 'password')) { exit('Login Failed'); }
  3. Reading contents of a file: $contents=$sftp-&gt;get('/file/on/remote/host.txt');
  4. Copying file over sftp with php from remote to local host: $sftp-&gt;get('/file/on/remote/host.txt', '/file/on/local/host.txt');
  5. Copying file over sftp with php from local to remote host: $sftp-&gt;put('/file/on/remote/host.txt', '/file/on/local/host.txt');
  6. Writing contents to remote file: $sftp-&gt;get('/file/on/remote/host.txt', 'contents to write');
  </code></pre>
  
  <p>I need to do #5, but it looks like what I did for SFTP. SFTP and SCP aren't the same, right? Is the same code correct? If not, how do I do SCP?</p>