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

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

遇到的问题是:

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

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

1、安装nghttp2

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

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

cd nghttp2

autoreconf -i

automake

autoconf

./configure

make

sudo make install

2、升级openssl

sudo apt-get install -y lib32z1 lib32ncurses5 lib32bz2-1.0

sudo apt-get install -y autoconf automake ca-certificates debhelper groff-base libgcrypt11-dev libdb-dev libgnutls-dev libidn11-dev libkrb5-dev libldap2-dev libnss3-dev librtmp-dev libssl-dev libtool openssh-server python quilt zlib1g-dev libssh2-1-dev

sudo apt-get install -y bc debhelper dpkg-dev m4

cd openssl-1.0.2l

./config --prefix=/usr/local shared -fPIC

make && sudo make install

3、升级curl

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

php5enable curl

service apache2 restart

赞 (0) 评论 分享 ()