PHP ftp_pasv() Function

The ftp_pasv() function turns passive mode on or off.In passive mode, data connections are initiated by the client, not the server. This is useful if the client is behind a firewall.

bool ftp_pasv ( resource $ftp_stream , bool $pasv )

ftp_pasv() turns on or off passive mode. In passive mode, data connections are initiated by the client, rather than by the server. It may be needed if the client is behind firewall.

Please note that ftp_pasv() can only be called after a successful login or otherwise it will fail.

Example -

ParameterDescription
ftp_streamThe link identifier of the FTP connection
pasvIf TRUE, the passive mode is turned on, else it's turned off

Returns TRUE on success or FALSE on failure.