安装php扩展服务:
wget -O php7.tar.gz http://cn2.php.net/get/php-7.1.1.tar.gz/from/this/mirror tar -xf php7.tar.gz cd php-7.1.1 yum install -y epel-release yum install -y libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel ./configure --prefix=/usr/local/php/php7 --with-config-file-path=/usr/local/php/php7/etc --enable-fpm --disable-debug --disable-rpath --enable-shared --with-iconv --enable-ftp make && make install vim /etc/profile #加上这句话 export PATH=$PATH:/usr/local/php/php7/bin/ source /etc/profile ls /usr/local/php ls /usr/local/php/php7 php -v
就是这样就安装好了
如果数据库安装好了,那么使用下面的编译
./configure --prefix=/usr/local/php/php7 --with-config-file-path=/usr/local/php/php7/etc --with-mysqli=/usr/local/mysql5.6/bin/mysql_config --with-pdo-mysql=/usr/local/mysql5.6 -enable-mbstring --enable-ftp --enable-fpm --with-curl --with-mhash --enable-zip --with-pcre-regex --with-gd --with-jpeg-dir -with-gettext --enable-xml
如果还需要其他操作 ,请使用 ./configure --help