У меня есть утилита PHP, которая подключается и загружает/загружает файл с/на FTPS с помощью ftp_connect(), и она отлично работает на моей локальной машине. Но с тем же кодом, загруженным на виртуальную машину GCP (CentOS 7), он не подключается к FTPS. Я открыл порт 990 и 5000-5016 для FTP.
$ftp_conn = ftp_connect(FTP_SERVER,990) or die("Could not connect to ".FTP_SERVER);
$login = ftp_login($ftp_conn, base64_decode($ftp_user), base64_decode($ftp_pass));
Поэтому в качестве обходного пути я хочу использовать команду curl
для подключения к FTPS-серверу.
curl -v -k --ftp-pasv --user user:pass ftps://myftps.com:990/ -v --trace trace.txt -3
Но curl
не работает даже на моей локальной машине. Пожалуйста, найдите ниже ответ трассировки
=> Send header, 5 bytes (0x5)
0000: 50 57 44 0d 0a PWD..
<= Recv header, 30 bytes (0x1e)
0000: 32 35 37 20 22 2f 22 20 69 73 20 63 75 72 72 65 257 "/" is curre
0010: 6e 74 20 64 69 72 65 63 74 6f 72 79 0d 0a nt directory..
== Info: Entry path is '/'
=> Send header, 6 bytes (0x6)
0000: 45 50 53 56 0d 0a EPSV..
== Info: Connect data stream passively
== Info: ftp_perform ends with SECONDARY: 0
<= Recv header, 26 bytes (0x1a)
0000: 35 30 30 20 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 500 Unknown comm
0010: 61 6e 64 20 45 50 53 56 0d 0a and EPSV..
== Info: Failed EPSV attempt. Disabling EPSV
=> Send header, 6 bytes (0x6)
0000: 50 41 53 56 0d 0a PASV..
<= Recv header, 52 bytes (0x34)
0000: 32 32 37 20 45 6e 74 65 72 69 6e 67 20 50 61 73 227 Entering Pas
0010: 73 69 76 65 20 4d 6f 64 65 20 28 31 37 32 2c 32 sive Mode (172,2
0020: 31 2c 32 35 33 2c 32 35 34 2c 31 39 2c 31 33 36 1,253,254,19,136
0030: 29 2e 0d 0a )...
== Info: Trying xxx.xx.xx.x ...
== Info: Connecting to xxx.xx.xx.x (xxx.xx.xx.x) port 5000
== Info: Connection timed out
== Info: Failed connect to myftps.com:990; Connection timed out
== Info: Closing connection 0
Любая помощь будет оценена. Спасибо