php 升级程序,升级编译安装的PHP程序(php-7.1.5升级到php-7.1.11)

本教程原PHP版本为php-7.1.5,将升级至php-7.1.11

Centos版本为CentOS Linux release 7.3.1611 (Core)

步骤:

1.下载源码

2.解压

3.编译

4.配置

5.启动

一.下载源码

wget http://cn2.php.net/distributions/php-7.1.11.tar.gz

二.解压

tar -zxvf php-7.1.11.tar.gz

三.编译

#进入目录

cd php-7.1.5/

#写入配置文件

./configure \

--prefix=/usr/local/php \

--with-curl \

--with-freetype-dir \

--with-gd \

--with-gettext \

--with-iconv-dir \

--with-kerberos \

--with-libdir=lib64 \

--with-libxml-dir \

--with-mysqli \

--with-openssl \

--with-pcre-regex \

--with-pdo-mysql \

--with-pdo-sqlite \

--with-pear \

--with-png-dir \

--with-xmlrpc \

--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

注意:上述执行完成后,只用 make 就行了

四.配置

先结束所有的php进程

扩展延伸”结束所有PHP进程”的bash脚本

#!/bin/bash

php=`ps -ef | grep php-fpm | grep -v grep | awk '{print $2}' > phppid.ini`

if [ "$php" == "" ];then

while read line

do

kill -9 $line

done < phppid.ini

fi

然后执行

cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm

五.启动

/etc/init.d/php-fpm

开机启动:

vim /etc/rc.local

新增一行,写入/etc/init.d/php-fpm > dev/null 2>&1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值