quot;php_connect_nonb() failed: Operation now in progress (115)quot; happens intermittently(“php_connect_nonb() 失败:操作正在进行中 (115)间歇性发生)
问题描述
我们通过 FTP 使用 PHP cron 作业将一些文件发送给第三方.
We send some files across to a third party with a PHP cron job via FTP.
但有时我们会收到以下错误:
However sometimes we get the following error:
ErrorException [ 2 ]: ftp_put(): php_connect_nonb() failed: Operation
now in progress (115) ~ MODPATH/fileop/classes/Drivers/Fileop/Ftp.php [ 37 ]
当我说有时"时,我的意思正是如此;大多数时候它都很好,但大约五分之一的时候我们会得到这个错误.这与文件本身无关,因为如果我们再试一次,它们会很开心.
When I say "sometimes" I mean exactly that; most times it goes across fine but about 1 in 5 times we get that error. It's not to do with the files themselves, because they will go happily if we try again.
我们在网上发现了类似的问题 - 与 PHP 中的错误 与 NAT 设备或与防火墙配置有关,但再次暗示如果是这种情况,它将永远工作.
We've found similar issues online - relating to a bug in PHP with NAT devices or to do with firewall configuration but again the implication is that if this were the case it would never work.
那么,为什么这有时会起作用而其他时候却不起作用?
So, why would this work some times and not others?
推荐答案
ftp_set_option($ftpconn, FTP_USEPASVADDRESS, false);
设置被动连接前的这行代码ftp_pasv($ftpconn, true);
This line of code before setting passivity of the connection ftp_pasv($ftpconn, true);
解决了我的问题
这篇关于“php_connect_nonb() 失败:操作正在进行中 (115)"间歇性发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“php_connect_nonb() 失败:操作正在进行中 (115)"间歇性发生


- Laravel 仓库 2022-01-01
- SoapClient 设置自定义 HTTP Header 2021-01-01
- 带有通配符的 Laravel 验证器 2021-01-01
- 从 PHP 中的输入表单获取日期 2022-01-01
- PHP Count 布尔数组中真值的数量 2021-01-01
- 正确分离 PHP 中的逻辑/样式 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 如何定位 php.ini 文件 (xampp) 2022-01-01
- 没有作曲家的 PSR4 自动加载 2022-01-01
- Mod使用GET变量将子域重写为PHP 2021-01-01