Q: Phpseclib showing Login Failed I am connecting SFTP server by using the phpseclib. I am using custom port to connect to SFTP. It is connected successfully using filezilla with port number 2222. When i connected using phpseclib it showing Login failed. I am using the code:
<?php
   set_include_path(get_include_path() . PATH_SEPARATOR . './phpseclib');
   include('Net/SFTP.php');
   define('NET_SFTP_LOGGING', NET_SFTP_LOG_COMPLEX);
    $sftp = new Net_SFTP('IP Address',2222); 
   if (!$sftp->login('username', 'password')) {
 print_r($sftp->getSFTPErrors()); 
   echo $sftp->getLog();
        exit('Login Failed');
    }
     else{ echo "connected";
     } 
    echo $sftp->pwd() . "\r\n"; 
    print_r($sftp->nlist());
    ?>

Please help
