开发环境和生产环境使用的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条评论, 我也要评论