找不到插座运输" SSL" - 你忘了启用它,当你配置PHP? [英] Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

查看:1584
本文介绍了找不到插座运输" SSL" - 你忘了启用它,当你配置PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌上搜索如何这个错误了很多个小时。我试着从这个话题没有运气。 &LT ;?的phpinfo(); ?> 它并不显示任何realated到SSL(我使用的应用程序服务器,而不是IIS的唯一区别)。还有什么我应该尝试一下呢?

完整的错误消息:

 < B>警告< / B&GT ;:的fsockopen()< A HREF ='function.fsockopen'> function.fsockopen< / A>]:无法连接到SSL://smtp.gmail.com:465(?找不到插座运输和放大器; QUOT; SSL&安培; QUOT;  - 你忘了启用它,当你配置PHP)上述< b> C:\\的appserv \\ WWW \\ webgitz \\测试\\ class.smtp.php< / b>上线474; B> 122 LT; / B>< BR />
SMTP - >错误:无法连接到服务器:找不到插座运输SSL - 你忘记启用它,当你配置PHP? (27010016)

和code:

 < PHPrequire_oncevalidation.phprequire_oncePHPMailer.php
require_onceclass.smtp.php$电子邮件=foo@gmamcil.com;$邮件=新的PHPMailer();
$ MAIL-GT&; IsSMTP();
$ MAIL-GT&; SMTPAUTH = TRUE; //启用SMTP认证
$ MAIL-GT&;港口= 465; //设置SMTP服务器端口
$ MAIL-GT&; HOST =smtp.gmail.com; // Gmail的SMTP服务器
$ MAIL-GT&; SMTPDebug = 2;
$ MAIL-GT&; SMTPSecure ='SSL';
$ MAIL-GT&;用户名=xxxxxx@gmail.com; // Gmail用户名
$ MAIL-GT&;密码=*********; // Gmail密码
$ MAIL-> AddReplyTo(XXXXX@gmail.com,AAAA); //回复电子邮件地址
$ MAIL-肽从=XXXX@gmail.com;
$ MAIL-GT&; FROMNAME =...; //出现名称一旦发送电子邮件
$ MAIL-GT&;学科=...; //邮件的主题
$ MAIL-GT&;身体=你好世界,< BR />这是HTML BODY< BR />中; // HTML正文
$ MAIL-GT&; AltBody =...; //可选,commentA并测试
$ MAIL-GT&;自动换行= 50; //设置自动换行
$ MAIL-GT&; MsgHTML($味精); // [可选]发送电子邮件的身体作为HTML
$ MAIL-GT&; AddAddress($电子邮件,fooo);收件人//电子邮件地址
$ MAIL-GT&; IsHTML(真); // [可选]作为发送HTML如果($ MAIL-GT&;!发送())回声'OK';其他回声错误;
?>


解决方案

检查您的php.ini文件,就可以了,如果你有这样的:

 ;延长= php_openssl.dll

将其更改为

 扩展= p​​hp_openssl.dll

在此之后,记得要重新启动Apache,可以使用应用程序服务器提供任何控制面板,或者使用服务Windows系统的控制面板上。

另外要确保php_openssl.dll是,该系统可以达到一个文件夹上,许多人使用它们复制到C来解决DLL选址问题问题:\\ W​​indows或C:\\ Windows \\ System32下。虽然这不应该是必要的。

在此之后,执行一个文件的phpinfo,并检查它的启用。

我已经读的地方,无法查明的,有些安装那种wamps的有不止一个的php.ini,但只有一个是真正活跃的,会不会是你编辑的错吗?

I'm googling for how to this error a lot of hours. I've tried all solutions from this topic without luck. <? phpinfo(); ?> (the only difference I'm using Appserver instead of IIS) it doesn't show anything realated to SSL. What else should I try?

The full error message:

<b>Warning</b>:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport &quot;ssl&quot; - did you forget to enable it when you configured PHP?) in <b>C:\AppServ\www\webgitz\test\class.smtp.php</b> on line <b>122</b><br />
SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (27010016)

and code:

<?php 

require_once "validation.php";

require_once "PHPMailer.php";


require_once "class.smtp.php";

$email= "foo@gmamcil.com";

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth   = true; // enable SMTP authentication
$mail->Port       =465;                    // set the SMTP server port
$mail->Host = "smtp.gmail.com"; // GMAIL's SMTP server
$mail->SMTPDebug = 2;
$mail->SMTPSecure = 'ssl';
$mail->Username   = "xxxxxx@gmail.com"; // GMAIL username
$mail->Password   = "*********"; // GMAIL password
$mail->AddReplyTo("XXXXX@gmail.com","AAAA"); // Reply email address
$mail->From = "XXXX@gmail.com";
$mail->FromName = "...."; // Name to appear once the email is sent
$mail->Subject = "...."; // Email's subject
$mail->Body = "Hello World,<br />This is the HTML BODY<br />"; //HTML Body
$mail->AltBody = "..."; // optional, commentA out and test
$mail->WordWrap = 50; // set word wrap
$mail->MsgHTML($msg); // [optional] Send body email as HTML
$mail->AddAddress("$email", "fooo");  // email address of recipient
$mail->IsHTML(true); // [optional] send as HTML

if(!$mail->Send()) echo 'ok'; else echo 'error';    
?>

解决方案

Check your php.ini file, on it, if you have this:

;extension=php_openssl.dll

change it to

extension=php_openssl.dll

After that, remember to restart Apache, either using any control panel that Appserver offers, or using the services windows on the control panel of the system.

Also be sure that php_openssl.dll is on a folder that the system can reach, many people use to solve the problem of dll location problems by copying them to C:\windows or C:\windows\system32. Although that shouldn't be necessary.

After that, execute a file with phpinfo and check that it's enabled.

I have read somewhere, can't pinpoint it, that some installation of that kind of wamps have more that one php.ini, but only one is really active, could it be that you have edited the wrong one?

这篇关于找不到插座运输&QUOT; SSL&QUOT; - 你忘了启用它,当你配置PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆