今天开发说php不能发邮件,一看发现没有openssl,想在编译php时就把openssl编译进去加--enable-ssl,如果没有安装的话,那么就按照下面的步骤添加openssl模块

cd /wdzj/source/php-5.6.11/ext/openssl

#/wdzj/lnmp/php5.6.11/bin/phpize
Cannot find config.m4.
Make sure that you run '/wdzj/lnmp/php5.6.11/bin/phpize' in the top level source directory of the module

cp config0.m4 config.m4

yum -y install autoconf

/wdzj/lnmp/php5.6.11/bin/phpize 

./configure --with-openssl --with-php-config=/wdzj/lnmp/php5.6.11/bin/php-config

make; make install

vi /wdzj/lnmp/php5.6.11/lib/php.ini

extension = openssl.so

 

发送邮件报下面的错误

[Composer\Downloader\TransportException]
  The "http://packages.zendframework.com/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  Failed to enable crypto
解决办法下:
cd /wdzj/lnmp/php/php/extensions/no-debug-non-zts-20131226/
curl http://curl.haxx.se/ca/cacert.pem -o cacert.pem
然后修改php.ini文件
openssl.cafile=/wdzj/lnmp/php/php/extensions/no-debug-non-zts-20131226/cacert.pem

重启php-fpm






 

 

  

 

相关文章:

  • 2021-07-06
  • 2021-08-21
  • 2022-01-07
  • 2021-05-27
  • 2021-05-18
  • 2021-12-14
  • 2022-01-04
  • 2021-11-02
猜你喜欢
  • 2021-07-15
  • 2021-10-09
  • 2021-05-16
  • 2022-12-23
  • 2022-02-20
  • 2021-06-30
相关资源
相似解决方案