错误信息:
Swift_TransportException
Connection could not be established with host smtp.126.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
错误原因:php openssl 没有加载 ca 证书 , 下载个 ca 证书 配置下php.ini 即可
解决步骤:
1.进入自己安装的php目录的
2.下载ca证书:wget http://curl.haxx.se/ca/cacert.pem 或者 直接下载:http://curl.haxx.se/ca/cacert.pem
3.编辑 php.ini:vim php.ini
4.找到openssl.cafile配置项,修改为openssl.cafile=/usr/local/php/etc/cacert.pem
该路径是步骤2下载的cacert.pem目录