You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PHP 5.6环境下PHPMailer报stream_select()错误的原因排查求助

PHP 5.6下PHPMailer stream_select错误解决记录

问题状态

  • 2022年11月24日更新:问题已解决,未定位到根本原因,推测是PHP源码损坏导致。从PHP官网重新下载对应版本源码覆盖原文件后,错误消失。

环境说明

  • 本地系统:Windows 10
  • 仅PHP 5.6版本触发错误,PHP 7.0及以上版本使用PHPMailer完全正常
  • 无socket相关知识,无法自行排查底层问题

触发的两类错误

TLS协议+25端口场景

Connection failed. Error #2: stream_select(): unable to select [11]: No such file or directory

SSL协议+465端口场景

Connection failed. error #2: stream_select(): unable to select [11]: Resource temporarily unavailable.

两类错误均由PHPMailer/src/SMTP.php文件第1228行的stream_select()函数调用引发。

调试日志(SSL协议+465端口场景)

Connection: opening to ssl://smtp.qq.com:465, timeout=300, options=array()
Connection: opened
Connection failed. Error #2: stream_select(): unable to select [11]: Resource temporarily unavailable (max_fd=772) [\vendor\phpmailer\phpmailer\src\SMTP.php line 1228]
SMTP -> get_lines(): select failed (stream_select(): unable to select [11]: Resource temporarily unavailable (max_fd=772))
SERVER -> CLIENT:
Connection: closing due to error
Connection: closed
SMTP Error: Could not connect to SMTP host.

内容的提问来源于stack exchange,提问作者lee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.12 09:21:01