cenots7编译安装php7.1.23

进入官网下载源码 http://php.net/downloads.php 选择对应的版本

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

 yum安装依赖

    yum -y install libxml2
    yum -y install libxml2-devel
    yum -y install openssl
    yum -y install openssl-devel
    yum -y install curl
    yum -y install curl-devel
    yum -y install libjpeg
    yum -y install libjpeg-devel
    yum -y install libpng
    yum -y install libpng-devel
    yum -y install freetype
    yum -y install freetype-devel
    yum -y install pcre
    yum -y install pcre-devel
    yum -y install libxslt
    yum -y install libxslt-devel
    yum -y install bzip2
    yum -y install bzip2-devel    

 配置PHP

./configure --prefix=/www/php-7.1.23 --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip

 编译参数有很多,具体有哪些可以执行:./configure --help 参考

编译:

make

这个时间比较漫长~~~

 如果遇到这样的错误可以尝试执行:make distclean 之后在此执行make (我是在执行 make & make install 时出现了这样的错误,但是如果先make编译之后在执行make install 就没有发现这样的问题,不太清楚是什么鬼)

libtool: link: `ext/opcache/ZendAccelerator.lo' is not a valid libtool object

 编译完成

安装

make install

 

php安装完成

猜你喜欢

转载自www.cnblogs.com/smala/p/9896434.html
今日推荐