如果是替换php版本需要先停止php-fpm服务
service php-fpm stop
1、首先yum编译必备的包
yum -y install libxml2 libxml2-devel curl-devel libpng-devel freetype-devel libmcrypt-devel libjpeg-devel
2、下载php7
cd /usr/local/src
wget http://cn2.php.net/distributions/php-7.0.14.tar.gz
解压:tar xzf php-7.0.14.tar.gz
3、cd到php--7.0.4.tar.gz编译安装
./configure --prefix=/usr/local/php7 --enable-fpm --enable-opcache --with-config-file-path=/usr/local/php-7.0.14/etc
--with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-static --enable-sockets --enable-wddx --enable-zip --enable-calendar
--enable-bcmath --enable-soap --with-zlib --with-iconv --with-freetype-dir --with-gd --with-jpeg-dir --with-xmlrpc --enable-mbstring
--with-sqlite3 --with-curl --enable-ftp --with-mcrypt --with-openssl --with-gettext --enable-pcntl
安装:
make &