1

While trying to connect the server through ftp_ssl_connect I'm facing two issues.

$conn_id = ftp_ssl_connect($ftp_server, <port_num>, 20)
$login_result = ftp_login( $conn_id, $ftp_user_name, $ftp_user_pass );
  1. In this above command while using the port_num as 22 it showing the message

    Couldn't connect to ssl

    But while using 0 as port_num its getting connected.

  2. There other issue was, while using 0 as port_num the ftp_login throws the following error

    Warning: ftp_login(): Command not implemented for that parameter

Note: I have tried to connect the server through FileZilla – it's working.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
sethuraman
  • 187
  • 7

1 Answers1

0

The ftp_ssl_connect connects using FTPS protocol (FTP over TLS/SSL).

The port 22 is used for SFTP protocol (over SSH).

Those are completely different protocols.

See How to SFTP with PHP?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992