问题复现
configure: WARNING: unrecognized options: --with-mcrypt, --enable-gd-native-ttf
问题分析
php7.2以后不支持–with-mcrypt, --enable-gd-native-ttf 这两个参数,需要去掉
问题解决
php编译我一开始用的源码:
[root@xinsz08 php-7.3.6]# './configure' '--prefix=/app/php' '--with-pdo-pgsql' '--with-zlib-dir' '--with-freetype-dir' '--enable-mbstring' '--with-libxml-dir=/root/data/php-7.3.6/ext/libxml' '--enable-soap' '--enable-calendar' '--with-curl' '--with-gd' '--with-pgsql' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-zlib' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl' '--enable-mbregex' '--with-freetype-dir=/usr/include/freetype2/freetype ' '--enable-exif' '--enable-bcmath' '--with-mhash' '--enable-zip' '--with-pcre-regex' '--with-pdo-mysql' '--with-mysqli' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-openssl' '--with-fpm-user=zmedu' '--with-fpm-group=zmedu' '--with-libdir=/lib/x86_64-linux-gnu/' '--enable-ftp' '--with-gettext' '--with-xmlrpc' '--with-xsl' '--enable-opcache' '--enable-fpm' '--with-iconv' '--with-xpm-dir=/usr' '--with-apxs2=/app/httpd24/bin/apxs'
去掉 --with-mcrypt, --enable-gd-native-ttf 之后
变成下面的源码:
下次编译php7.2的时候,可以直接复制下面的内容:
[root@xinsz08 php-7.3.6]# ‘./configure’ ‘–prefix=/app/php’ ‘–with-pdo-pgsql’ ‘–with-zlib-dir’ ‘–with-freetype-dir’ ‘–enable-mbstring’ ‘–with-libxml-dir=/root/data/php-7.3.6/ext/libxml’ ‘–enable-soap’ ‘–enable-calendar’ ‘–with-curl’ ‘–with-gd’ ‘–with-pgsql’ ‘–disable-rpath’ ‘–enable-inline-optimization’ ‘–with-bz2’ ‘–with-zlib’ ‘–enable-sockets’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enable-pcntl’ ‘–enable-mbregex’ '–with-freetype-dir=/usr/include/freetype2/freetype ’ ‘–enable-exif’ ‘–enable-bcmath’ ‘–with-mhash’ ‘–enable-zip’ ‘–with-pcre-regex’ ‘–with-pdo-mysql’ ‘–with-mysqli’ ‘–with-jpeg-dir=/usr’ ‘–with-png-dir=/usr’ ‘–with-openssl’ ‘–with-fpm-user=zmedu’ ‘–with-fpm-group=zmedu’ ‘–with-libdir=/lib/x86_64-linux-gnu/’ ‘–enable-ftp’ ‘–with-gettext’ ‘–with-xmlrpc’ ‘–with-xsl’ ‘–enable-opcache’ ‘–enable-fpm’ ‘–with-iconv’ ‘–with-xpm-dir=/usr’ ‘–with-apxs2=/app/httpd24/bin/apxs’