我尝试在遗留的Ubuntu12.04.05 LTS上用PCRE 8.40编译PHP7.1.5:
1 .我从源代码编译了PCRE 8.40到/usr/local/pcre。
2,配置PHP:
./configure --prefix=/usr/local/php7 --with-pcre-regex=/usr/local/pcre --with-pcre-dir=/usr/local/pcre
没有错误。
3 .编译PHP:
make
错误:
ext/pcre/.libs/php_pcre.o: In function `zm_globals_dtor_pcre':
/root/php-7.1.5/ext/pcre/php_pcre.c:139: undefined reference to `pcre_jit_stack_free'
ext/pcre/.libs/php_pcre.o: In function `php_free_pcre_cache':
/root/php-7.1.5/ext/pcre/php_pcre.c:113: undefined reference to `pcre_free_study'
ext/pcre/.libs/php_pcre.o: In function `zm_activate_pcre':
/root/php-7.1.5/ext/pcre/php_pcre.c:223: undefined reference to `pcre_jit_stack_alloc'
ext/pcre/.libs/php_pcre.o: In function `pcre_get_compiled_regex_cache':
/root/php-7.1.5/ext/pcre/php_pcre.c:525: undefined reference to `pcre_assign_jit_stack'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
我试过一个实验:
./configure --prefix=/usr/local/php7 --disable-all --with-pcre-regex=/usr/local/pcre --with-pcre-dir=/usr/local/pcre
(-禁用所有:禁用默认启用的所有扩展。)
make
没有错误,构建完成。
$/usr/local/php7/bin/php -i | grep "PCRE Library Version"
PCRE Library Version => 8.40 2017-01-11
发布于 2018-04-18 01:37:35
我也有同样的问题。用--enable-jit
编译PCRE,为我解决了这个问题。
https://serverfault.com/questions/852681
复制