虚心使人进步

虚心学习,天天向上......
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

centos curl版本nss改成openssl

Posted on 2015-08-06 01:02  Showker  阅读(12792)  评论(0编辑  收藏  举报

 

 ====

最新流程2018-05-14

先yum update openssl

再yum update curl

curl -V 

如果直接显示已经是OpenSSL版本了

重启一下php-fpm即可,不需要下面的方式。。。

 

 

 

上面的yum方式不行的话,走这个更新流程

 1、系统的curl生成

wget http://curl.haxx.se/download/curl-7.35.0.tar.gz
tar -zxvf  curl-7.35.0.tar.gz
cd  curl-7.35.0.tar.gz

cd /www/src/curl-7.39.0
./configure --prefix=/usr/local/curl --without-nss --with-ssl
make && make install

备份默认的curl二进制文件
sudo mv /usr/bin/curl /usr/bin/curl.bak
然后做一个新的curl软链
sudo ln -s /usr/local/curl/bin/curl /usr/bin/curl

然后再curl --version确认是否已经是openssl的版本

 

2、生成curl.so 

cd /www/src/lanmp/php-5.2.17/ext/curl
/www/wdlinux/php/bin/phpize
./configure --with-php-config=/www/wdlinux/php/bin/php-config --with-curl=/usr/local/curl/

 make && make install

3、重新编译php(php.ini找出原先的配置参数,复制,去掉with-curl,然后编译

cd /www/src/lanmp/php-5.2.17/

./configure  '--prefix=/www/wdlinux/apache_php-5.2.17' '--with-config-file-path=/www/wdlinux/apache_php-5.2.17/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-mysqli=/www/wdlinux/mysql/bin/mysql_config' '--with-pdo-mysql=/www/wdlinux/mysql' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization'  '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--enable-bcmath' '--enable-exif' '--enable-sockets' '--enable-zip' '--with-apxs2=/www/wdlinux/apache/bin/apxs'

 make && make install

4、编译完后,在php.ini里增加

extension=curl.so

重启php-fpm即可

 

=====

如果你在linux服务器经常需要安装新的php应用,那难免会遇到需要重新编译php,给它增加新的功能的情况。重新编译php后,一方面需要替换掉原来的php,另一方面需要保障其他在线网站的正常运转,就需要对php进行平滑替换了。这个过程该如何进行呢?给出一点我在这方面积累的经验。

1、找出原来php的配置参数

~:php -i|grep configure
Configure Command =>  './configure'  '--prefix=/usr/local/php' '--enable-mbstring' '--enable-fastcgi' '--enable-fpm' '--with-curl' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config'


./configure  '--prefix=/www/wdlinux/apache_php-5.2.17' '--with-config-file-path=/www/wdlinux/apache_php-5.2.17/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-mysqli=/www/wdlinux/mysql/bin/mysql_config' '--with-pdo-mysql=/www/wdlinux/mysql' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl=/usr/local/curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--enable-bcmath' '--enable-exif' '--enable-sockets' '--enable-zip' '--with-apxs2=/www/wdlinux/apache/bin/apxs'