繁体   English   中英

php ftp_connect over explicit connection with without authentication

[英]php ftp_connect over explicit connection with no authentication

我已经从一个服务器移动到另一个服务器,其中包含以下功能:

public function ftpConnect() {

            $this->ftpHost = $this->getVar('ftp','host');
            $this->ftpUsername = $this->getVar('ftp','username');
            $this->ftpPassword = $this->getVar('ftp','password');

            $this->ftpStream = @ftp_connect($this->ftpHost);
            $ftpLogin = @ftp_login($this->ftpStream, $this->ftpUsername, trim($this->ftpPassword));

            $rootList = ftp_nlist($this->ftpStream, '.');
            if (in_array('public_html', $rootList)) {
                ftp_chdir($this->ftpStream, 'public_html/');    
            }

            $this->createDirs();
        }

但新服务器必须将ftp与SSL / TLS连接,并使用显式加密和无身份验证。

我试图改变@ftp_connect@ftp_ssl_connect ,但它仍然没有想知道,有没有别的东西我不这样做?

或者是所有需要的东西以及它使用的ftp细节都不正确?

任何帮助都是永远感激的。

由于某种原因,ftp详细信息没有正确复制。 我重置了ftp密码,将@ftp_connect更改为@ftp_ssl_connect ,所有错误都消失了。 我已经离开了这个问题以防其他人想知道如何通过php连接到ftp显式。

暂无
暂无

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

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