php 7.2.2源码安装
1.安装阿里云源
cd /usr/local/src/ wget http://mirrors.aliyun.com/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm
2.安装php依赖文件
yum install zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel libxslt-devel libmcrypt-devel mhash mhash-devel mcrypt openssl-devel libcurl-devel libjpeg-turbo-devel libtool-ltdl-devel -y cd /usr/local/src wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz tar -zxvf libiconv-1.15.tar.gz cd libiconv-1.15 ./configure --prefix=/usr/local/libiconv make && make install
3.安装php 7.2.2
cd /usr/local/src wget http://cn2.php.net/distributions/php-7.2.2.tar.gz tar -zxvf php-7.2.2.tar.gz cd php-7.2.2 ./configure --prefix=/usr/local/php-7.2.2 \ --with-fpm-user=nginx \ --with-fpm-group=nginx \ --with-mysql=shared,mysqlnd \ --with-mysqli=shared,mysqlnd \ --with-pdo-mysql=shared,mysqlnd \ --with-iconv-dir=/usr/local/libiconv \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib \ --with-libxml-dir=/usr \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --with-curl \ --enable-fpm \ --enable-xml \ --enable-mbstring \ --with-mcrypt \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --enable-static \ --with-xsl \ --enable-ftp \ --with-gettext \ --enable-bcmath \ --enable-opcache make make install
4.配置php文件
ln -s /usr/local/php-7.2.2/ /usr/local/php cp /usr/local/src/php-7.2.2/php.ini-production /usr/local/php/lib/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf cp /usr/local/src/php-7.2.2/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm chmod +x /etc/init.d/php-fpm