The ftp_ssl_connect() function opens a secure SSL-FTP connection.
ftp_ssl_connect(host,port,timeout);
host − FTP server address. It can be a domain name address or an IP address.
#port − The port to connect to. The default is 21.
timeout − Timeout period for network operations.
The ftp_ssl_connect() function returns the SSL-FTP stream on success, and returns FALSE on error.
The following is an example −
<?php $ftp_server = "192.168.0.4"; $ftp_user = "jacob"; $ftp_pass = "tywg61gh"; $ftp_conn = ftp_ssl_connect($ftp_server) or die("Could not connect to $ftp_server"); $login = ftp_login($ftp_conn, $ftp_user, $ftp_pass); // close SSL connection ftp_close($ftp_conn); ?>
The above is the detailed content of ftp_ssl_connect() function in PHP. For more information, please follow other related articles on the PHP Chinese website!