我正在尝试使用 php 命令连接到 FTP。但是当我尝试登录时出现以下错误
Warning: ftp_login(): Non-anonymous sessions must use encryption
我试过的代码:
ftp_connect($ftp_server)
ftp_get($ftp_conn, $local_file, $server_file, FTP_ASCII)
虽然它是通过 FileZilla 连接的。不确定错误的含义。谢谢
最佳答案
也许你应该使用 FTPS而不是 FTP,这是链接的摘录:
In order to maintain compatibility with existing non-TLS/SSL-aware FTP clients, implicit FTPS was expected to listen on the IANA Well Known Port 990/TCP for the FTPS control channel, and to 989/TCP for the FTPS data channel. This allowed administrators to retain legacy-compatible services on the original 21/TCP FTP control channel.
FTP 服务器可能位于您连接的端口上,只是告诉您需要通过 FTP over SSL 连接到另一个端口。
在 PHP 中使用 FTP over SSL : ftp_ssl_connect()
。
关于php - 非匿名 session 必须使用加密,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30759998/