PHP ftp_ssl_connect () function
Definition and Usage
ftp_ssl_connect () function to open a secure SSL-FTP connection.
When the connection is open, you can run the FTP server function.
grammar
ftp_ssl_connect(host,port,timeout)
参数 | 描述 |
---|---|
host | 必需。规定要连接的 FTP 服务器。可以是域名地址或 IP 地址。该参数不能包含 "ftp://" 或者斜线。 |
port | 可选。规定 FTP 服务器的端口。默认是 21。 |
timeout | 可选。规定该 FTP 连接的超时时间。默认是 90 秒。 |
Examples
This example attempts to connect to an FTP server. If the connection fails, you die () function to terminate the script, and outputs a message:
<?php
$conn = ftp_ssl_connect("ftp.testftp.com") or die("Could not connect");
?>
$conn = ftp_ssl_connect("ftp.testftp.com") or die("Could not connect");
?>
Complete PHP FTP Reference