php-src icon indicating copy to clipboard operation
php-src copied to clipboard

Compile php with mbstring result in `symbol lookup error: mbstring.so: undefined symbol: pcre2_compile_8`

Open kocoten1992 opened this issue 4 years ago • 1 comments

Description

The following code:

wget -qO- https://www.php.net/distributions/php-8.1.4.tar.xz | tar -xJv
cd php-8.1.4
./configure
make

cd ext/mbstring
phpize && ./configure && make

Here is my php.ini

...
extension_dir=.
extension=mbstring.so
...

When I run ./php -c php.ini (php is newly complied with newly php.ini and mbstring.so), it result in:

./php: symbol lookup error: php-cli-ext/mbstring.so: undefined symbol: pcre2_compile_8

Compiling is success, if I remove ext mbstring in php.ini, php seem to work again, I don't know where it when wrong, have try to google it but found nothing.

PHP Version

8.1.4

Operating System

Ubuntu 22.04

kocoten1992 avatar Mar 20 '22 06:03 kocoten1992

I still don't know how to solve it, guess something is wrong with pcre2 on my computer, I cannot compile statistically ./configure --enable-mbstring with the faulty computer (it would result in different error that doesn't exist on google).

However, compile statically with different computer with --enable-mbstring result in a php binary I could use, other ext like openssl, pdo_pgsql, zlib... doesnt seem to be affected, just mbstring, think I'll just close this issue.

kocoten1992 avatar Mar 20 '22 14:03 kocoten1992