Build PHP 7.1/7.2 in Linux
开发环境和生产环境使用的Linux发行版,都没有官方的PHP7.0以上的安装包,只能通过自己手动编译的方式,打包后上传到镜像内。
分享一下我使用的编译参数:
PHP 7.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
./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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
./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–
近期评论