ftp_ssl_connect可以处理TLS上的隐式FTP吗?默认情况下,它使用显式.
我正在尝试上传到一个服务器,该服务器只接受端口990上的隐式ftp over tls;有没有人遇到这个?你怎么修好它的?
解决方法:
ftp_ssl_connect只是显式的
如果你需要隐式,请使用curl
$fp = fopen($path, 'r');
$ftp_server = 'ftps://'.$server.'/'.$filename;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ftp_server);
curl_setopt($ch, CURLOPT_USERPWD,$user.':'.$pass);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_FTP_SSL, CURLFTPSSL_TRY);
curl_setopt($ch, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS);
curl_setopt($ch, CURLOPT_UPLOAD, 1);
curl_setopt($ch, CURLOPT_INFILE, $fp);
$output = curl_exec($ch);
$error_no = curl_errno($ch);
//var_dump(curl_error($ch));
curl_close($ch);