聚合国内IT技术精华文章,分享IT技术精华,帮助IT从业人士成长

Build PHP 7.1/7.2 in Linux

2018-11-05 00:05 浏览: 1449046 次 我要评论(0 条) 字号:

开发环境和生产环境使用的Linux发行版,都没有官方的PHP7.0以上的安装包,只能通过自己手动编译的方式,打包后上传到镜像内。

分享一下我使用的编译参数:

PHP 7.1

./configure 
    --prefix=/home/***/php7.1 
    --with-config-file-path=/home/***/php7.1/etc 
    --enable-fpm 
    --with-mcrypt 
    --with-gd 
    --enable-gd-native-ttf 
    --with-jpeg-dir 
    --with-freetype-dir 
    --with-png-dir 
    --with-libxml-dir 
    --enable-xml 
    --enable-mbregex 
    --with-mcrypt=/usr/local/bin 
    --with-mysqli 
    --enable-soap 
    --enable-mbstring 
    --enable-pdo 
    --with-pdo-mysql 
    --with-curl=/usr/local/curl 
    --with-mhash 
    --enable-opcache 
    --enable-bcmath 
    --with-openssl 
    --with-zlib 
    --enable-pcntl 
    --enable-sockets 
    --with-ldap 
    --with-ldap-sasl 
    --enable-zip

PHP 7.2

./configure 
    --prefix=/home/***/php7.2 
    --with-config-file-path=/home/***/php7.2/etc 
    --enable-fpm 
    --with-gd 
    --with-jpeg-dir 
    --with-freetype-dir 
    --with-png-dir 
    --with-libxml-dir 
    --enable-xml 
    --enable-mbregex 
    --with-mysqli 
    --enable-soap 
    --enable-mbstring 
    --enable-pdo 
    --with-pdo-mysql 
    --with-curl=/usr/local/curl 
    --with-mhash 
    --enable-opcache 
    --enable-bcmath 
    --with-openssl 
    --with-zlib 
    --enable-pcntl 
    --enable-sockets 
    --with-ldap 
    --with-ldap-sasl 
    --enable-zip

执行完成后,执行 make && make intall 即可

–EOF–



网友评论已有0条评论, 我也要评论

发表评论

*

* (保密)

Ctrl+Enter 快捷回复