ftp_ssl_connect
Open a secure SSL-FTP connection.
The ftp_ssl_connect()
function opens a secure SSL-FTP connection.
When the connection is open, you can run the FTP function on the server.
This example attempts to connect to an FTP server. If the connection fails, the die() function terminates the execution of the script and outputs a message:
<?php $conn = ftp_ssl_connect ( "ftp.testftp.com" ) or die ( "Could not connect" ) ; ?>
ftp_ssl_connect ( host , port , timeout )
parameter | describe |
---|---|
host |
Required. Specifies the FTP connection to be used (the identifier of the FTP connection). Can be a domain name 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 time for the FTP connection. The default is 90 seconds. |