|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-09-09 08:09 UTC] abrender at elitehosts dot com
Description: ------------ In response to the PASV command, FTP servers sometimes return their IP address (10.X for example) and PHP honors this IP address, stores it in ftp->pasvaddr and uses that for future connections. This is problematic because PHP won't be able to communicate with a server behind a NAT device using passive FTP. The attached patch adds the USEPASVADDRESS option (a boolean) which can be set and read via the ftp_set_option() and ftp_get_option() functions. USEPASVADDRESS is set to TRUE by default to preserve existing functionality. When USEPASVADDRESS is set to FALSE, the ftp extension will ignore the IP address returned by the PASV command and instead use the IP address passed to ftp_connect() (or ftp_ssl_connect()) In the future we may expand the values to include AUTO which would ignore any RFC 1918 IP addresses returned by the PASV command. The only thing to note is that the call to ftp_set_option() must be made before ftp_pasv() is called. Patchesftp_usepasvaddress_php70.patch.patch (last revision 2016-01-23 04:52 UTC by edistro01 at gmail dot com)ftp_usepasvaddress_php70.patch (last revision 2015-12-10 12:00 UTC by kaplan@php.net) ftp_usepasvaddress.patch (last revision 2011-09-09 08:10 UTC by abrender at elitehosts dot com) Pull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 09:00:01 2025 UTC |
The patch can be applied up until 5.6.10, after that is it requires a small typo change in ext/ftp/ftp.h to work ("configureable" -> "configurable"). It needs adaptation for the 7.0 branch.