imi框架定时任务:协程发送邮件报错:SMTP ERROR:Failed to connected to Server:SMTP connect() failed.

运行环境:centos 7.4+ imi2.0+php7.4+swoole 4.8

错误截图:

SMTP ERROR:Failed to connected to Server:

SMTP connect() failed.

按照错误提示:

https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

sudo setsebool -P httpd_can_sendmail 1
sudo setsebool -P httpd_can_network_connect 1

进入找到对应的地方,修改后还是不能正常工作.

宇润大佬最后让运行php --ri swoole

告诉我说是swoole没有安装openssl

最后我重装swoole解决这个问题,感谢宇润大佬!

./configure --enable-openssl --enable-http2 --enable-async-redis --enable-mysqlnd --with-php-config=/www/server/php/74/bin/php-config

make && make install

swoole安装openssl详细教程参考:http://www.majianwei.com/archives/9078