How to set a custom SFTP port with phpseclib

后端 未结 1 1144
被撕碎了的回忆
被撕碎了的回忆 2021-01-21 02:09

I have to connect to SFTP server by using PHP. I am using phpseclib for that. I found some example on Internet, but I am not able to connect to SFTP. I am using a custom port (2

相关标签:
1条回答
  • 2021-01-21 02:58

    You can define a custom port like so:

    Net_SFTP('www.domain.tld', 2222);
    

    You can see it when you look in the constructor from SFTP class which is like this:

    function Net_SFTP($host, $port = 22, $timeout = 10)
    {
    
    }
    
    0 讨论(0)
提交回复
热议问题