GMail fsockopen():Codeigniter和XAMPP的SSL操作失败错误 [英] GMail fsockopen(): SSL operation failed error with Codeigniter and XAMPP
问题描述
错误消息1:消息:fsockopen():SSL操作失败,代码为1. OpenSSL错误消息:错误:14090086:SSL例程:ssl3_get_server_certificate:证书验证失败
文件名:libraries / Email.php
行号:1962
错误消息2:消息:fsockopen():未能启用加密
错误消息3:消息:fsockopen():无法连接到> ssl://smtp.gmail.com:465(未知错误)
php.ini:extension = php_openssl.dll
- > uncommented
I已经尝试过: openssl.cafile = C:\xampp\perl\vendor\lib\Mozilla\CA\cacert.pem
我尝试过使用禁用的防火墙
我尝试过使用另一个网络
Codeigniter PHP代码:
$ config = Array(
'protocol'=>'smtp',
'smtp_host'=>'ssl://smtp.gmail.com',
'smtp_port'=> 465,
'smtp_user'=> 'asd@gmail.com',
'smtp_pass'=> 'asd',
'mailtype'=> 'html',
'charset'=> 'utf-8'
);
$ this-> load->库('email',$ config);
$ this-> email-> set_newline(\r\\\
); ('1@gmail.com','asd');
$ this-> email->
$ this->电子邮件 - >到($收件人);
$ this->电子邮件 - >主题($ a);
$ this->电子邮件>消息($ b);
$ this-> email-> send();
在我的情况下,Avast Antivirus阻止了端口。我使用SMTP端口 465 从我的CodeIgniter项目发送电子邮件。它显示了一个错误:
$ b
fsockopen()无法启用加密功能
只需禁用Avast Antivirus即可解决问题。
可选解决方案
但是,如果您想保留您的Avast安全性,您应该: 打开Avast
清除您在重定向设置中使用的端口 MAIL 部分
关闭Avast
Error message 1: Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Filename: libraries/Email.php
Line Number: 1962
Error message 2: Message: fsockopen(): Failed to enable crypto Error message 3: Message: fsockopen(): unable to connect to >ssl://smtp.gmail.com:465 (Unknown error)
php.ini: extension=php_openssl.dll
-> uncommented
I have tried with: openssl.cafile= C:\xampp\perl\vendor\lib\Mozilla\CA\cacert.pem
I have tried with disabled firewall
I have tried with another network
Codeigniter PHP Code:
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_port' => 465,
'smtp_user' => 'asd@gmail.com',
'smtp_pass' => 'asd',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('1@gmail.com', 'asd');
$this->email->to($recipient);
$this->email->subject($a);
$this->email->message($b);
$this->email->send();
In my case, the Avast Antivirus was blocking the port. I was using the SMTP port 465 for sending an email from my CodeIgniter project. It showed an error:
fsockopen() failed to enable crypto
Simply disabling the Avast Antivirus solved the problem.
Alternative Solution
But if you want to keep your Avast security on, you should:
Open Avast
Click on Settings (upper right corner of page)
Click on Troubleshooting
Click on Redirect Settings
Clear the port you used from Redirect Settings's MAIL section
Click OK
Close Avast
这篇关于GMail fsockopen():Codeigniter和XAMPP的SSL操作失败错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!