1. Download the installation package
Http://cn2.php.net/distributions/php-7.2.4.tar.gz
2. Install dependent environment
Yum install-y pcre-devel zlib-devel libxml2-devel openssl-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng- Devel libmcrypt-devel readline-devel libxslt libxslt-devel autoconf gcc-c++ freetype-devel libicu-devel libxml2 Libxml2-devel
3. Unzip the installation
TAR-ZXVF php-7.2.4.tar.gz
CD php-7.2.4
mkdir/usr/local/php
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/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- -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--disable-fileinfo--enable-opcache--with-xsl
Make && make install
4. Configuration
#添加环境变量
Echo ' path= '/usr/local/php/bin: $PATH ' >>/etc/profile;source/etc/profile
#做软连接, Scheduled Tasks require
Ln-s/usr/local/php/bin/php/usr/bin/php
CentOS 7 LNMP Deployment-php