centos release 6.10 下安装php7.1.0

下安装依赖

sudo yum install 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 zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel

下载安装包,解压

wget http://php.net/distributions/php-7.1.0.tar.gz
tar -zxvf php-7.1.0.tar.gz
cd php-7.1.0

预编译

./configure \
--prefix=/usr/local/php \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-libxml-dir \
--with-xmlrpc \
--with-mhash \
--with-pcre-regex \
--with-sqlite3 \
--enable-opcache=no \
--with-zlib \
--enable-bcmath \
--with-iconv \
--enable-calendar \
--with-curl \
--with-cdb \
--enable-dom \
--enable-exif \
--enable-fileinfo \
--enable-filter \
--with-pcre-dir \
--with-zlib-dir \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-mhash \
--enable-json \
--enable-mbstring \
--enable-mbregex \
--enable-mbregex-backtrack \
--with-libmbfl \
--with-onig \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-pdo-sqlite \
--enable-session \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-libxml-dir \
--with-xsl \
--enable-mysqlnd-compression-support \

编译&安装

sudo make -j8 && sudo make install

修改环境变量

sudo vim /etc/profile
末尾加上export PATH="/usr/local/php/bin:$PATH"
source /etc/profile

查看版本 php --version
image.png

你可能感兴趣的:(centos release 6.10 下安装php7.1.0)