title: sftp script to login to the server
body: <p>I am using a script to login to the server using sftp with keys. I am getting the below errors while accessing the server using the script. Errors are as below :</p>
  
  <pre><code>: No such file or directory
  ./new.php: line 2: syntax error near unexpected token \`'SSH_HOST','
  '/new.php: line 2: `define( 'SSH_HOST', 'IP_Address' );
  </code></pre>
  
  <p>See below the script I am using :</p>
  
  <pre><code>&lt;?php
  define( 'SSH_HOST', 'IP_Address' );
  define( 'SSH_PORT', 7475 );
  
  define( 'SSH_PUBLIC_KEY', '/home/test/test_sftp.pub' );
  define( 'SSH_PRIVATE_KEY', '/home/test_sftp.ppk' );
  define( 'SSH_USERNAME', 'test55' );
  define( 'SSH_PASSWORD', 'lkdlkdsf' );
  
  //define( 'SSH_USERNAME', 'test5654' );
  //define( 'SSH_PASSWORD', 'dfsfsd45' );
  
  
  set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
  include_once('Net/SSH2.php');
  include_once('Net/SFTP.php');
  include_once('Crypt/RSA.php');
  include_once('Crypt/Hash.php');
  include_once('Math/BigInteger.php');
  
  $rsa = new Crypt_RSA();
  //$pubKey = file_get_contents('id_rsa.pub');
  //$rsa-&gt;setPublicKey($pubKey);
  $priKey = file_get_contents(SSH_PRIVATE_KEY);
  $rsa-&gt;loadKey($priKey);
  
  $sftp = new Net_SFTP(SSH_HOST, SSH_PORT);
  
  if (!$sftp-&gt;login(SSH_USERNAME, $rsa)) {
      echo 'error:';
          print_r($sftp-&gt;getLog());
      exit("Login Failed\n");
  }
  echo $sftp-&gt;pwd() . "\r\n";
  //$sftp-&gt;put('filename.ext', 'Hiiii!');
  </code></pre>