问题
I have to retrieve a file by using FTPS :
$ftp = ftp_ssl_connect($ftp_server, 9921, 10);
$bool = ftp_login($ftp, $login, $pass);
ftp_pasv($ftp, true);
$files = ftp_nlist($ftp, "/");
var_dump($files);
die();
But I have this warnings, and $files is false
Warning: ftp_login() [function.ftp-login]: SSL/TLS handshake failed in xxx\view.importfromadmin.php on line 81
Warning: ftp_login() [function.ftp-login]: Using authentication type TLS in xxx\view.importfromadmin.php on line 81
How can I fixe it ?
回答1:
I can copy my file using this :
$ftp_path = "ftps://$ftp_login:$ftp_password@$ftp_server:9921/".$import_file;
copy($ftp_path, $uploadFileName);
回答2:
I think your issue is going to lay with OpenSSL not being compiled with PHP. You can find more information about that here: http://www.deciacco.com/blog/php/php-openssl-and-ftp_ssl_connect-on-win32
With information on how to fix it as well. You can check if your PHP has OpenSSL compiled through the phpinfo. Given that you are running a Windows server check the link above. Since you did not provide that information this is just a random guess.
来源:https://stackoverflow.com/questions/5553681/ftp-login-ssl-tls-handshake-failed