WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP ftp_ssl_connect () function


Definition and usage

ftp_ssl_connect () function opens a secure SSL-FTP connection.

When the connection is open, you can run FTP functions on the server.

Syntax

ftp_ssl_connect (host, port, timeout)

parameters description
host Required. Specifies the FTP server to connect to. Can be a domain name address or an IP address. This parameter cannot contain "ftp: //" or a slash.
port Optional. Specifies the port of the FTP server. The default is 21.
timeout Optional. Specifies the timeout for this FTP connection. The default is 90 seconds.


Example

This example attempts to connect to an FTP server. If the connection fails, the die () function terminates the script and prints a message:

<?php
$conn = ftp_ssl_connect("ftp.testftp.com") or die("Could not connect");
?>