但是有时我们会收到以下错误:
ErrorException [ 2 ]: ftp_put(): PHP_connect_nonb() Failed: Operation now in progress (115) ~ MODPATH/fileop/classes/Drivers/Fileop/Ftp.PHP [ 37 ]
当我说“有时”时我就是这么说的;大多数情况下,它很好,但我们得到的错误大约是五分之一.这与文件本身无关,因为如果我们再试一次,他们会很开心.
我们在网上发现了类似的问题 – 与使用NAT设备的bug in PHP相关或者与防火墙配置有关,但这意味着,如果是这种情况,它将无法工作.
那么,为什么有些时候会有效呢?
This page有一个很好的总结:
The easy way is to simply allow FTP servers and clients unlimited
access through your firewall,but if you like to limit their access to
“known” ports,you have to understand the 4 different scenarios.1) The FTP server should be allowed to accept TCP connections to port
21,and to make TCP connections from port 20 to any (remote ephemeral)
port.2) The FTP server should be allowed to accept TCP connections to port
21,AND to accept TCP connections to any ephemeral port as well!3) The FTP client should be allowed to make TCP connections to port
21,and to accept TCP connections from port 20 to any ephemeral port.4) The FTP client should be allowed to make TCP connections to port 21,and to make TCP connections to any other (remote ephemeral) port as well!