ubuntu14.04升级php curl,支持http2发送APNs

网上升级很多都不完整,不是这里出错就是那里出错。

遇到的问题是:

一、首先升级curl,这个比较容易,虽然支持http2,但是利用命令发送不了APNs的消息,明明支持http2,可以发送消息的头部依然是http/1.1。找了很多资料,需要升级openssl

二、升级openssl也容易,但是编译了很多次,curl -V查看版本的时候,openssl依然是老版本

总结问题,要cURL支持http2,必须满足openssl >= 1.0.2 , cURL >= 7.46.0

安装库文件

sudo apt-get install g++ make binutils autoconf automake git autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libxml2-dev libev-dev libevent-dev libssl-dev libjansson-dev libjemalloc-dev cython python3-dev python-setuptools

1、升级openssl

sudo add-apt-repository ppa:0k53d-karl-f830m/openssl

sudo apt-get update

sudo apt-get install openssl

2、安装nghttp2

git clone https://github.com/tatsuhiro-t/nghttp2.git

cd nghttp2

autoreconf -i

automake

autoconf

./configure

make

sudo make install

3、升级curl

sudo apt-get build-dep curl

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

tar zxvf curl-7.55.1.tar.gz

cd curl-7.55.1

./configure --prefix=/usr/local --with-nghttp2=/usr/local --with-ssl

make -s && sudo make install

sudo ldconfig

4、升级php5-curl

apt-get remove php5-curl

apt-get install php5-curl

php5enmod curl

service apache2 restart

转载于:https://my.oschina.net/csq/blog/1538982

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值