title: How do i use phpseclib to upload file from my php server -> someOther server?
body: <p>I'm trying to upload a file from my php server to some other server
  (my workplace is quite lame enough to block ssh traffic)</p>
  
  <p>Anyway, here's what I'm trying to do:
  (at: /public_html/manage.php</p>
  
  <pre><code>&lt;?php
  
  set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib/phpseclib');
  include('Net/SSH2.php');
  include('Net/SFTP.php');
  
  $ssh = new Net_SSH2('SomeServer',22); //starting the ssh connection to localhost
  if (!$ssh-&gt;login('root', '12345')) { //if you can't log on...
      exit('ssh Login Failed');
  }
  $sftp = new Net_SFTP('SomeServer',22);
  if (!$sftp-&gt;login('root', '12345')) { //if you can't log on...
      exit('sftp Login Failed');
  }
  echo $sftp-&gt;pwd();
  
  $output = $sftp-&gt;put('/root/1_yum_stuff.sh', '1_yum_stuff.txt');
  echo $output;
  $output = $ssh-&gt;exec('ls -a');
  //$output = $ssh-&gt;exec('./1_yum_stuff.sh &amp; 1&gt;1.txt');
  echo $output;
  $output = $ssh-&gt;exec('pwd');
  echo $output;
  echo("3rd try!");
  ?&gt;
  </code></pre>
  
  <p>The thing is, the file "1_yum_stuff.txt" is located at /public_html/ folder on my php server, and sftp just can't move the file.</p>
  
  <p>Anyway, is this the right way to use sftp module of phpseclib? (e.g. put?)</p>
  
  <p>Thanks:) !</p>