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?

1 Answer 1

0

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.