参考:https://www.latoooo.com/xia_zhe_teng/368.htm

我的系统版本是 Centos 7 64位。
为了方便,先安装常用的开发环境。

yum groupinstall Development tools

1.下载 OpenSSL:

wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz

2.解压 OpenSSL:

tar -xzvf openssl-1.0.2l.tar.gz

3.进入 OpenSSL目录:

cd openssl-1.0.2l

4.配置并编译 OpenSSL:

./config --shared
make && make install

5.下载 curl 库:

wget https://curl.haxx.se/download/curl-7.55.1.tar.gz

6.解压 curl 库:

tar -xzvf curl-7.55.1.tar.gz

7.进入 curl 目录:

cd curl-7.55.1

8.设置动态库路径:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ssl/lib

9.配置并编译 curl:

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

10.备份默认的 curl 二进制文件

mv /usr/bin/curl /usr/bin/curl.bak

11.做一个新的 curl 软链

ln -s /usr/local/curl/bin/curl /usr/bin/curl

总体的替换到此就完成,可以执行 curl --version 来进行确认。下边是我执行的结果:

curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2l
Release-Date: 2017-08-14
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy

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

找出原来php的配置参数

~:php -i|grep configure
./configure  '--prefix=/usr/local/php' '--with-freetype-dir=/usr/local/freetype' '--with-gd' '--with-gettext' '--with-iconv-dir' '--with-mysqli' '--with-openssl' '--with-pcre-regex' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-pear' '--with-png-dir=/usr/local/libpng' '--with-jpeg-dir=/usr/local/libjpeg' '--with-xsl' '--with-zlib' '--enable-fpm' '--enable-bcmath' '--enable-libxml' '--enable-inline-optimization' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvsem' '--enable-xml' '--enable-zip' '--with-curl=/usr/local/curl'

重启php-fpm  /usr/local/php/sbin/php-fpm

最新文章

  1. 4. SVM分类器求解(2)
  2. 一步一步学ROP之linux_x86篇
  3. js和jquery如何获取图片真实的宽度和高度
  4. java 反射获取类的属性 类型 名称和值
  5. Java class,Object,Class的区别
  6. ESXi 5.5 命令行克隆虚拟机
  7. Oracle连接字符串C#
  8. 如何让静态库中的可执行程序不调用的函数不链接进该可执行程序?(-ffunction-sections -Wl,--gc-sections)
  9. python学习小结8:I/O
  10. JAVA线程示范之一种
  11. CF 578A A Problem about Polyline
  12. cocos2d-x ios游戏开发初认识(八) 触摸事件与碰撞检測
  13. Hadoop: LongWritable cannot be cast to org.apache.hadoop.io.IntWritable
  14. js,jQuery实现可关闭悬浮框广告特效,兼容(谷歌,火狐,Ie)
  15. Hadoop(十三)分析MapReduce程序
  16. Swagger 配置
  17. Linux系统的命令别名功能(转)
  18. Codeforces 576E Painting Edges [分治,并查集]
  19. CUDA加opencv复现导向滤波算法
  20. 使用 select 实现 goroutine 超时

热门文章

  1. Nginx简单总结
  2. request.getRequestDispatcher("").forward()中文乱码
  3. Android深入浅出之Binder机制(转)
  4. ARM-JTAG-SWD-schematic
  5. 图解tensorflow 源码分析
  6. [转]Twemproxy 介绍与使用
  7. Continuous Integration for iOS Apps with Visual Studio Team Services
  8. 内存映射函数remap_pfn_range学习——代码分析(3)
  9. 使用Visual Studio 2012远程调试Windows Azure网站
  10. Maven编译时跳过Test