The ftp_ssl_connect() function opens a secure SSL-FTP connection.
When the connection is open, you can run FTP functions on the server.
ftp_ssl_connect(host,port,timeout)
parameter | describe |
---|---|
host | Required. Specifies the FTP server to connect to. It can be a domain name address or an IP address. This parameter cannot contain "ftp://" or slashes. |
port | Optional. Specifies the port of the FTP server. The default is 21. |
timeout | Optional. Specifies the timeout period for this FTP connection. The default is 90 seconds. |
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");?>