Linux环境下使用PHPmailer发送邮件时,出现如下错误:

SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (32690)

出现这个问题的原因是当初编译安装PHP缺少了ssl库。

可以重新再次编译PHP,加上--enable-openssl参数即可。

但是如果只为了安装这一个扩展就去重新编译,未免有点麻烦,其实可以简单一点,只要安装openssl.so扩展就可以了。

(1)找到之前编译安装PHP的安装包,或者从php的官网下载php7(本例使用php7,其他版本的PHP类似)

(2)解压并进入文件夹

    cd php7.0/ext/openssl

(3)运行 phpize:

    /usr/local/php/bin/phpize

备注,如果出现如下错误:Cannot find config.m4.

Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module

【解决办法】cp ./config0.m4 ./config.m4 即可解决

(4)编译和安装

    ./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
    make && make install

(5)然后进入最后提示的目录,查看文件如下:

(6)将 openssl.so 复制到PHP的扩展目录下:

    cp openssl.so /usr/local/php/include/php/ext

(7)找到php.ini,在最后面添加如下内容:

    extension=openssl.so

(8)重启php-fpm和nginx/apache,查看phpinfo();

 

   

Linux PHP7的openssl扩展安装的更多相关文章

  1. Laravel5 call to undefined function openssl cipher iv length() 报错 PHP7开启OpenSSL扩展失败

    在安装laravel5.5后, 访问显示报错. call to undefined function openssl cipher iv length() 经查为php7.1的OpenSSL扩展加载失 ...

  2. linux mongodb 及php-mongo扩展安装

    安装背景   php7.2.5   ubuntu18.04.1 MongoDb 安装 sudo apt-get install mongodb MongoDb的php扩展 sudo apt-get i ...

  3. Linux下,PHP扩展安装(使用yum安装)

    直接操作linux,在命令模式下用yum 来安装PHP的扩展: 扩展:mysqli 命令: yum install php-mysqli 扩展:pdo 命令: yum install php-pdo

  4. 在线上Linux下,PHP扩展安装(使用yum安装)

    直接操作linux,在命令模式下用yum 来安装PHP的扩展: 扩展:mbstring 命令: yum install php-mbstring* 扩展:GD库 命令:yum install php- ...

  5. linux下php redis扩展安装

    sudo tar vxzf redis-2.2.7.tgz cd redis-2.2.7 执行sudo /data/service/php54/bin/phpize 在目录下生成配置文件 sudo . ...

  6. centos php 扩展安装

    1. 安装mysqli扩展 1.进入php源代码目录:# cd /home/apps/web/php/php-5.3.5/ 2.再进入要添加的mysqli扩展源码目录:# cd ext/mysqli/ ...

  7. linux下包不重新编译php安装openssl 扩展

    今天在刚装好的centos上安装composer,老是报错,提示不安全的,后来发现是由于https的缘故,需要openssl,可能是开始装php的时候没有安装此扩展,网上有好多方案,一开始我认为只有重 ...

  8. PHP7 学习笔记(九)phpsize动态编译openssl扩展 (微信公众平台)

    先吐槽,微信公众平台授权出问题了,尽然访问不了 一.问题描述: 使用PHP中的库函数file_get_contents时出现Unable to find the wrapper "https ...

  9. 安装php openssl扩展

    安装openssl扩展 cp config0.m4 config.m4 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/loc ...

随机推荐

  1. js函数与 Promise的使用

    JavaScript的函数不但是“头等公民”,而且可以像变量一样使用,具有非常强大的抽象能力. 定义函数的方式如下: function abs(x) { if (x >= 0) { return ...

  2. 随机森林(Random Forest)

    决策树介绍:http://www.cnblogs.com/huangshiyu13/p/6126137.html 一些boosting的算法:http://www.cnblogs.com/huangs ...

  3. Web设计的速查卡(转)

    一.排版 1.VisiBone Font Card Download: GIF 2.常用字体表 (HTML) 3.混合字体 (PDF) 二.单元/尺寸 1.Points 和Pixels近似转换表 (H ...

  4. 负margin应用案例几则(转载+总结)

    (一)自适应布局——左栏改右栏 这里先写个一列固定列宽,另一列自适应的两列布局,效果图: 侧栏移至右边,效果图: 其HTML <div class="wrap"> &l ...

  5. (转)word尾注引文添加方式及相关问题

    word引文添加方式:http://www.office68.com/word/word-reference-add.html word通配符:http://www.3lian.com/edu/201 ...

  6. js 文件上传进度条

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  7. springmvc 发送PUT 和 DELETE 请求

    一: 发送 DELETE 或者 PUT 请求: 1.在表单中加入一个隐藏的参数: _method  , 值是 DELETE (或者PUT) <form action="springmv ...

  8. -pie can only be used when targeting iOS 4.2 or later

    网上下载的demo,执行报错-pie can only be used when targeting iOS 4.2 or later 解决的方法:选择target==>改动developmen ...

  9. M451 PWM对照数据手册分析

    PWM_T Struct Reference Control Register » Pulse Width Modulation Controller(PWM)   typedef struct { ...

  10. [Jenkins] Manage Jenkins from Web Interface

    URL 说明 [jenkins_url]/safeRestart This will restart Jenkins after the current builds have completed. ...