我正在尝试使用以下代码通过 PHP 进行 FTP 登录:
$ftp_conn = ftp_connect('XXX.XX.XXX.XXX') or die("Could not connect");
$login = ftp_login($ftp_conn, 'USER', 'PASS');
var_dump($login);
Run Code Online (Sandbox Code Playgroud)
但我不断收到此错误:
ftp_login(): 登录名或密码不正确!
不过,我可以通过 FileZilla 等 FTP 程序成功使用这些凭据。我的凭据真的有错吗?
有任何想法吗?
FileZilla 日志文件:
$ftp_conn = ftp_connect('XXX.XX.XXX.XXX') or die("Could not connect");
$login = ftp_login($ftp_conn, 'USER', 'PASS');
var_dump($login);
Run Code Online (Sandbox Code Playgroud)
禁用加密的 FileZilla 日志文件:
Status: Disconnected from server
Status: Connecting to XXX.XX.XXX.XXX:21...
Status: Connection established, waiting for welcome message...
Response: 220 Welcome to Claytons FTPS
Command: AUTH TLS
Response: 234 Using authentication type TLS
Status: Initializing TLS...
Status: Verifying …Run Code Online (Sandbox Code Playgroud)