stiloride
stiloride

Reputation: 3

adding port to net_sftp

I have a bit of PHP code that is responsible for logging into a SFTP server, it was working well before but now I need to add a port to the URL original code was as follows

   $sftp = new Net_SFTP('sftp.sftpurl.co.uk');
if (!$sftp->login('username', 'password')) {
        exit('Login Failed');
}

I have read on other pages that I should adjust to the following:-

   $sftp = new Net_SFTP('sftp.sftpurl.co.uk', 2222);
if (!$sftp->login('username', 'password')) {
        exit('Login Failed');
}

When I run the php it comes up with "login failed" but if I use filezilla with the same credentials its loading the remote server without problems.

Any advice on how to get the php function to work in the same way as manual filezilla login?

Thanks

Upvotes: 0

Views: 567

Answers (0)

Related Questions