php - 非匿名 session 必须使用加密

标签 php ftp

我正在尝试使用 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/

相关文章:

php - 为什么 Zend 框架会在此处添加下划线?

java - 应该检索公共(public)FTPClient的文件从远程服务器删除文件

java - commons net ftp 问题

c++ - 如何取消 CFtpConnection::PutFile?

php - 将从字符串中选择 '2' 而不是 '12' 的 LIKE 子句

php - 使用表单发布(php)将文件上传到Azure存储,并返回链接

php - 专有网络服务器中的 session 管理

java - 如何判断 ListView 中选定的索引是文件还是目录?

java - 使用 Spring Integration 安排通过 FTP 进行远程文件下载并处理内存中的文件

php - Laravel whereIn 或 whereIn