给PHP安装openssl


Centos系统, 刚开始用lnmp装的PHP环境,本来是要安装composer的,但是在这行这个命令的时候

curl -sS https://getcomposer.org/installer | php

就报错了:

Some settings on your machine make Composer unable to work properly.

Make sure that you fix the issues listed below and run this script again:


The openssl extension is missing, which means that secure HTTPS transfers are impossible.

If possible you should enable it or recompile php with --with-openssl

不能忍啊,于是就给php安装openssl扩展,首先进入PHP源码包的ext/openssl目录下,执行以下命令,参见:http://www.52jscn.com/web/2013/05/4592.shtml

mv config0.m4 config.m4
/var/www/php5/bin/phpize
./configure --with-openssl --with-php-config=/path/to/php5/bin/php-config
make
make install

果断生成openssl.so,于是添加到php.ini中,执行service php-fpm restart,果断报错:openssl是未识别的PHP扩展。

接着折腾,参见:http://www.cnblogs.com/ycoe/archive/2012/02/15/2352604.html

在php源码目录上使用 ./configure --help查看配置所有可用参数,可以发现,找不到 --enable-ssl
取而代之的是:
--with-openssl-dir 
--with-openssl
既然如此,就直接用它了
./configure  --with-openssl-dir=/usr/lib/openssl --with-openssl

目前仍在编译中~~~~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值