title: php send file to sftp
body: <p>I am trying to send a file with SFTP I get error while I am trying to upload the file.
  Permissions on the remote folder are ok.</p>
  
  <pre><code>$connection = ssh2_connect('10.0.10.245', 22);
  ssh2_auth_password($connection, $ftp_user_name, $ftp_user_pass);
  $sftp = ssh2_sftp($connection);
  echo '&lt;br&gt;';
  ssh2_scp_send($connection,$file,"/a.xml", 0644);
  print_r(error_get_last());
  </code></pre>
  
  <p>the error I got is: </p>
  
  <pre><code>Array 
  ( 
      [type] =&gt; 2 
      [message] =&gt; ssh2_scp_send(): Failure creating remote file 
      [file] =&gt; /var/www/FP1/sendFTP.php 
      [line] =&gt; 93 
   ) 
  </code></pre>
  
  <p>Any advise?</p>