简体   繁体   English

与phpseclib连接会产生sftp错误111

[英]connecting with phpseclib gives sftp error 111

I'm using phpseclib to connect to a sftp server using the NET/sftp.php NET_SFTP class included in the library as such: 我正在使用phpseclib连接到sftp服务器,使用库中包含的NET / sftp.php NET_SFTP类:

/* sftp connection */
    $this->log[] =  '<b>Connecting to:</b> <i>'.$this->ftpServer.'</i><br/>';
    // Set up a connection
    $sftp = new Net_SFTP($this->ftpServer, $this->ftpPort);
    if (!$sftp->login($this->ftpUsername, $this->ftpPassword)) {
    exit('Login Failed');
    }
    echo $sftp->pwd() . "\r\n";
    $sftp->put('filename.ext', 'hello, world!');
    print_r($sftp->nlist());

I have chceked that the ftpServer and ftpPort variables are correct and my output is: 我已经知道ftpServer和ftpPort变量是正确的,我的输出是:

Notice: Cannot connect to nasl2-itpartner.ddns.me:2223. 注意:无法连接到nasl2-itpartner.ddns.me:2223。 Error 111. Connection refused in /home/itpabse/public_html/administrator/components/com_itpartner_backup/assets/php/sftp/Net/SSH2.php on line 1049 错误111.第1049行/home/itpabse/public_html/administrator/components/com_itpartner_backup/assets/php/sftp/Net/SSH2.php中的连接被拒绝

Login Failed 登录失败

The problem is I cant find documentation for error 111 anywhere. 问题是我无法在任何地方找到错误111的文档。 I have tried connecting to the server with filezilla using sftp ssh no problem. 我尝试使用sftp ssh连接到带有filezilla的服务器没问题。 Any thoughts on what may be going wrong here? 对这里可能出错的任何想法?

Logfile from filezilla connecting to the server from the same machine running the script: https://drive.google.com/file/d/0B5BDN-5z0pdmeWM2T093S3dIS2s/view?usp=sharing 来自filezilla的日志文件从运行脚本的同一台计算机连接到服务器: https//drive.google.com/file/d/0B5BDN-5z0pdmeWM2T093S3dIS2s/view?usp =sharing

My firewall for outgoing communication as not open for PHP. 我的防火墙用于传出通信,因为PHP没有打开。 It was for the ftp client which was why a connection was able to be made that way. 这是为了ftp客户端,这就是为什么能够以这种方式建立连接的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM