-2
$connection = ssh2_connect('sftp://xx.xx.xx.xx', 22) or die ('fail');
if (ssh2_auth_password($connection, 'user', 'password')) {

  echo "Authentication Successful!\n";

} else {

  die('Authentication Failed...');

}


// my result is: fail ;
Muhammad Shahzad
  • 9,340
  • 21
  • 86
  • 130

2 Answers2

0

Filezilla, i think has nothing related in functions to php as it is not coded on it.

I would recommend you to check this answer

EDIT: Also check this from the php manual, sftp connections.

Please let me know if this works for you,

Tom

Community
  • 1
  • 1
0

You don't need to put sftp://. Just the IP should be fine.

Also please format your code correctly for Stack Overflow.

Source: http://php.net/manual/en/function.ssh2-connect.php

Jonah
  • 71
  • 8