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 ?
I can copy my file using this :
$ftp_path = "ftps://$ftp_login:$ftp_password@$ftp_server:9921/".$import_file;
copy($ftp_path, $uploadFileName);
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.