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


基础教程推荐
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01