基礎環境:php
系統:centos6.8 環境:lnmp mysql
中止PHP7.0的版本,在作以下操做:sql
1.下載php-7.2.6.tar.bz2軟件包放在/opt 路徑下centos
mkdir /usr/local/php7.2php7
2.tar xf php-7.2.6.tar.bz2curl
3.cd php-7.2.6socket
4../configure --prefix=/usr/local/php7.2 --with-config-file-path=/usr/local/php7.2/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local/curl --enable-mbregex --enable-mbstring --enable-intl --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --enable-fileinfo --enable-opcache --with-xslphp-fpm
5.make && make installurl
6.cp /opt/php-7.2.6/php.ini.devolepment /usr/local/php7.2/etc/php.inixml
7.cp /usr/local/php7.2/etc/php-fpm.conf.default /usr/local/php7.2/etc/php-fpm.conf
8.cd /etc/init.d/
9.改PHP7.0的啓動腳本,將路徑改爲/usr/local/php7.2
10.改環境變量,將以前的PATH改爲php7.2的路徑
11.php -v 查看版本是否升級成功
12.運行新版本的php,完成升級。
service php-fpm start