• centos curl版本nss改成openssl


     ====

    最新流程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'

    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'

  • 相关阅读:
    (二)php的常量和变量
    关于标签系统的一点想法。
    Linux运维工程师中级面试题
    Linux C 编程内存泄露检测工具(一):mtrace
    掌握sudo的使用
    Scala极速入门
    处理千万级以上的数据提高查询速度的方法
    linux svn服务器搭建、客户端操作、备份与恢复
    select/poll/epoll 对比
    汇编指令和标志寄存器
  • 原文地址:https://www.cnblogs.com/showker/p/4706271.html
Copyright © 2020-2023  润新知