无法find套接字传输“ssl” – 你忘了configurationPHP时启用它?

我正在search如何这个错误很多小时。 我试过这个话题的所有解决scheme, 但没有运气。 <? phpinfo(); ?> <? phpinfo(); ?> (唯一的区别我使用Appserver而不是IIS)它不显示任何与SSL相关的任何东西。 还有什么我应该尝试?

完整的错误信息:

 <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) 

和代码:

 <?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'; ?> 

检查你的php.ini文件,如果你有这个:

 ;extension=php_openssl.dll 

改变它

 extension=php_openssl.dll 

之后,请记住使用Appserver提供的任何控制面板或使用系统控制面板上的服务窗口重新启动Apache。

另外请确保php_openssl.dll位于系统可以访问的文件夹中,许多人通过将它们复制到C:\ windows或C:\ windows \ system32来解决dll定位问题。 虽然这不应该是必要的。

之后,用phpinfo执行一个文件并检查它是否被启用。

我已经阅读了某处,无法找到它,一些安装这种wamps有更多的一个php.ini,但只有一个是真正活跃,可能是你编辑错了吗?

我有一个类似的错误与SSL几个小时。

什么对我来说是复制php\libeay32.dllphp\ssleay32.dllphp\ext\php_openssl.dll从PHP目录到Apache2.2\bin目录。 然后重新启动Apache。

对于一些人来说,这些解决方案是行不通的。

对我来说,解决方案是这样的:将dll libeay32.dll和ssleay32.dll复制到服务器的bin目录 – apache。

该解决方案建议在http://php.net/manual/fa/openssl.installation.php的评&#x8BBA;

当我查看错误日志时,我知道问题出在加载DLL并将它们放到服务器目录中是唯一的方法。

正确的答案是更换线路

 ;extension=php_openssl.dll 

php.ini文件中

 extension=php_openssl.dll 

如果你不能在php.ini文件中找到extension=php_openssl.dll ,那么只需简单地在文件中添加以下行:

 extension=php_openssl.dll 

这应该工作!