1. 安装必备软件
sudo yum -y update sudo yum -y install apr* sudo yum -y install autoconf sudo yum -y install automake sudo yum -y install bison sudo yum -y install bzip2 sudo yum -y install bzip2-devel sudo yum -y install compat* sudo yum -y install cpp sudo yum -y install curl sudo yum -y install curl-devel sudo yum -y install freetype sudo yum -y install freetype-devel sudo yum -y install gcc sudo yum -y install gcc-c++ sudo yum -y install gd sudo yum -y install git sudo yum -y install glibc sudo yum -y install kernel sudo yum -y install kernel-headers sudo yum -y install libjpeg sudo yum -y install libjpeg-devel sudo yum -y install libpng sudo yum -y install libpng-devel sudo yum -y install libselinux-devel sudo yum -y install libstdc++-devel sudo yum -y install libtool* sudo yum -y install libxml2 sudo yum -y install libxml2-devel sudo yum -y install make sudo yum -y install MysqL-devel sudo yum -y install openssl sudo yum -y install openssl-devel sudo yum -y install pcre-devel sudo yum -y install perl sudo yum -y install PHP-common sudo yum -y install PHP-gd sudo yum -y install zlib-devel sudo yum -y install readline readline-devel
2. PHP configure
#! /bin/bash ./configure --prefix=/usr/local/PHP7.1.5 \ --with-openssl \ --enable-fpm \ --enable-sockets \ --with-MysqLi=/usr/bin/MysqL_config \ --enable-mbstring \ --with-gd \ --enable-gd-native-ttf \ --with-jpeg-dir \ --with-png-dir \ --with-zlib-dir \ --with-libxml-dir=/usr \ --enable-xml \ --with-config-file-path=/usr/local/PHP7.1.5 \ --with-config-file-scan-dir=/usr/local/PHP7.1.5/PHP.d \ --with-curl \ --enable-zip \ --enable-bcmath \ --enable-pdo \ --with-pdo-MysqL \ --with-readline
3. 拷贝安装PHP-fpm
[lai@localhost PHP-7.1.5]$ sudo cp sapi/fpm/init.d.PHP-fpm /etc/init.d/PHP-fpm [lai@localhost PHP-7.1.5]$ sudo chmod 755 /etc/init.d/PHP-fpm
设置开机自动启动
[lai@localhost PHP-7.1.5]$ sudo /sbin/chkconfig PHP-fpm on原文链接:https://www.f2er.com/centos/377569.html