go to bug id or search bugs for
php-7.0.25/ext/pcre/php_pcre.c:113: undefined reference to `pcre_free_study'
I tried to compile with JIT and without JIT, I get errors either way. The errors are in the file above, in different lines.
ext/pcre/.libs/php_pcre.o: In function `php_free_pcre_cache':
php-7.1.11/ext/pcre/php_pcre.c:113: undefined reference to `pcre_free_study'
If you turn on JIT then you get the following error when running make:
_SIGNALS -c /php-7.1.11/ext/pcre/php_pcre.c -o ext/pcre/php_pcre.lo
p/php-7.1.11/ext/pcre/php_pcre.c:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘pcre_handle_exec_error’:
/php-7.1.11/ext/pcre/php_pcre.c:93: error: ‘PCRE_ERROR_JIT_STACKLIMIT’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:93: error: (Each undeclared identifier is reported only once
/php-7.1.11/ext/pcre/php_pcre.c:93: error: for each function it appears in.)
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘php_free_pcre_cache’:
/php-7.1.11/ext/pcre/php_pcre.c:113: warning: implicit declaration of function ‘pcre_free_study’
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘zm_globals_dtor_pcre’:
/php-7.1.11/ext/pcre/php_pcre.c:138: error: ‘jit_stack’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:139: warning: implicit declaration of function ‘pcre_jit_stack_free’
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘zm_info_pcre’:
/php-7.1.11/ext/pcre/php_pcre.c:168: error: ‘PCRE_CONFIG_JIT’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘zm_activate_pcre’:
/php-7.1.11/ext/pcre/php_pcre.c:222: error: ‘jit_stack’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:223: warning: implicit declaration of function ‘pcre_jit_stack_alloc’
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘pcre_get_compiled_regex_cache’:
/php-7.1.11/ext/pcre/php_pcre.c:511: error: ‘PCRE_STUDY_JIT_COMPILE’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:524: error: ‘jit_stack’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:525: warning: implicit declaration of function ‘pcre_assign_jit_stack’
make: *** [ext/pcre/php_pcre.lo] Error 1
Here is the compile command in use:
./configure --build=x86_64-redhat-linux-gnu \
I expect it to compile with make successfully.
It fails to compile with make when using either the latest 7.1 or 7.0 publicly downloadable source files.
Add a Patch
Add a Pull Request
> --with-pcre-regex=/usr \
Please try without this configuration option to force usage of the
bundled libpcre. Would that succeed?
Also, what is the PCRE version you have tried to compile against?
Fedora 26: pcre-8.41-3.fc26.x86_64
it makes not much sense compile a recent PHP7.0/PHP7.1 against completly outdated system libraries
> it makes not much sense compile a recent PHP7.0/PHP7.1 against
> completly outdated system libraries
ACK. However, we're still checking for libpcre ≥ 6.6 even in
master, what likely has to be adjusted to let ./configure fail
instead of make.
You make a good point, I didn't think about the libraries being that old.
I did try with the --use-pcre-regex=/usr, I still see php-7.0.25/ext/pcre/php_pcre.c:113: undefined reference to `pcre_free_study'
the same error.
I agree, it should be caught in the configure, checking for which pcre lib is being used, would have avoided reporting this bug.
I agree that, my bad, didn't realize how old RHEL 6.x was, but many places still use this, RHEL7x adoption is not as high, not as much certified with it sometimes.
I was able to use php56 latest available, and went with that, do appreciate your help looking at this.
If possible, to help others, appreciate you to update configure to check for pcre lib, and possible to express using --with-pcre-regex=/usr as alternative for someone who might run into this, as error when it fails, and then feel free to close this, would be most appreciated.
Well, the situation has changed in the meantime. As of PHP 7.3.0,
libpcre2 is required, and there are appropriate version checks in
the configuration scripts. Furthermore, if in doubt just use the
default what is to use the bundled libpcre2 (which should be
compatible anyway). So I think this ticket can be closed.