Latest web development tutorials

PHP ftp_pasv () function

PHP FTP Reference Complete PHP FTP Reference

Definition and Usage

ftp_pasv () function to set the passive mode on or off.

In passive mode, data connections are initiated by a client to, rather than the server. This is useful when the client is behind a firewall.

grammar

ftp_pasv(ftp_connection,mode)

参数 描述
ftp_connection 必需。规定要使用的 FTP 连接。
mode 必需。规定模式。
  • TRUE = 被动模式打开
  • FALSE = 被动模式关闭


Examples

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

ftp_pasv($conn,TRUE);

ftp_close($conn);
?>


PHP FTP Reference Complete PHP FTP Reference