0

I tried to compile a PHP 7.1.5 with PCRE 8.40 on a legacy Ubuntu 12.04.05 LTS:

1, I compiled PCRE 8.40 from source to /usr/local/pcre.

2, configure PHP:

./configure --prefix=/usr/local/php7 --with-pcre-regex=/usr/local/pcre --with-pcre-dir=/usr/local/pcre

No error.

3, compile PHP:

make

Error:

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

I tried an experiment:

./configure --prefix=/usr/local/php7 --disable-all --with-pcre-regex=/usr/local/pcre --with-pcre-dir=/usr/local/pcre

(--disable-all: Disable all extensions which are enabled by default.)

make

No error, build complete.

$/usr/local/php7/bin/php -i | grep "PCRE Library Version"
PCRE Library Version => 8.40 2017-01-11

Why not working when I try without --disable-all option?

0

I had the same problem. Compile PCRE with --enable-jit solved this for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.