Centos中更新openssl、cur、php
PHP5 不支持 openssl1.1
openssl 降版本
1 wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
2 tar zxvf openssl-1.0.2o.tar.gz
3 cd openssl-1.0.2o
4 ./config -fPIC --prefix=/usr/local/openssl enable-shared
註釋: --prefix:指定安裝目錄 -fPIC:編譯openssl的靜態庫 enable-shared:編譯動態庫
5 ./config -t
6 make
7 make install
8 建立軟鏈接
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
9 修改系統自帶的庫
ln -s /usr/local/openssl/lib/libssl.so /usr/lib64/libssl.so
curl 從新編譯
1 wget https://curl.haxx.se/download/curl-7.60.0.tar.gz
2 tar -zxvf curl-7.60.0.tar.gz
3 cd curl-7.60.0
4 ./configure --with-ssl=/usr/local/openssl --prefix=/usr/local/curl
5 make & make install
6 建立軟鏈接
ln -s /usr/local/curl/bin/curl /usr/bin/curl
ln -s /usr/local/curl/include/curl /usr/include/curl
echo "/usr/local/curl/lib" >> /etc/ld.so.conf
7 curl -V
安裝php 5.6.36
1. wget http://cn.php.net/distributions/php-5.6.36.tar.gz
2. tar zxvf php-5.6.36.tar.gz
3. cd php-5.6.36
4 配置:
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc \
--with-mysql=mysqlnd --with-mysqli=mysqlnd \
--enable-fpm --enable-mbstring=all \
--with-curl=/usr/local/curl \
--with-openssl=/usr/local/openssl
5 make && make install
6 中止php服務:
killall php-fpm
7 重啓php服務:
./php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf