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)"间歇性发生


基础教程推荐
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
- php中的PDF导出 2022-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- php中的foreach复选框POST 2021-01-01
- Web 服务器如何处理请求? 2021-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01