- 安装依赖包: ```shell yum -y install wget vim pcre pcre-devel openssl openssl-devel \ libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng \ libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib \ zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel \ curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel \ nss_ldap jemalloc-devel cmake boost-devel bison automake libevent \ libevent-devel gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt \ mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel \ libcurl libcurl-devel openjpeg-devel libcurl.x86_64 libcurl-devel.x86_64 \ libjpeg-turbo libjpeg-turbo-devel libpng freetype libpng-devel \ freetype-devel icu libicu libicu-devel openldap openldap-clients \ openldap-devel openldap-servers
cp -frp /usr/lib64/libldap* /usr/lib/
2. **解压、编译、安装**
```shell
tar zxvf php-7.2.6.tar.gz
cd php-7.2.6
./configure --prefix=/usr/local/server/php \
--with-apxs2=/usr/local/server/apache/bin/apxs \
--with-config-file-path=/usr/local/server/php \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-mysqlnd-compression-support \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--enable-intl \
--with-libmbfl \
--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-pear \
--enable-maintainer-zts \
--with-ldap=shared \
--without-gdbm
make && make install