Custom PHP static build issue with intl

I try to create a static PHP 7.1 binary with intl support:

./configure --prefix=/home/www/cretaftp/php --enable-static --enable-cli --disable-cgi --enable-mysqlnd --with-mysqli --with-curl --with-zlib --enable-mbstring --enable-calendar --with-gd --with-bz2 --enable-sockets --enable-ftp --with-gettext --with-xmlrpc --with-xsl --with-pdo-mysql --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-mcrypt --enable-soap --with-openssl --enable-intl --with-layout=GNU


But when I run:

make

I get this:

Code:
ld: error: undefined symbol: std::__throw_length_error(char const*)
>>> referenced by stl_vector.h:1756 (/usr/local/lib/gcc9/include/c++/bits/stl_vector.h:1756)
>>>               ext/intl/msgformat/.libs/msgformat_helpers.o:(std::vector<icu::Formattable, std::allocator<icu::Formattable> >::_M_default_append(unsigned long))

ld: error: undefined symbol: std::__throw_length_error(char const*)
>>> referenced by stl_vector.h:1756 (/usr/local/lib/gcc9/include/c++/bits/stl_vector.h:1756)
>>>               ext/intl/msgformat/.libs/msgformat_helpers.o:(std::vector<icu::UnicodeString, std::allocator<icu::UnicodeString> >::_M_default_append(unsigned long))
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.

If I remove --enable-intl from the ./configure command the issue doesn't exist.
 
I finally found a workaround using the ports tree:

Code:
cd /usr/ports/lang/php71

make extract

cd /usr/ports/lang/php71/work

./configure --prefix=/home/www/cretaftp/php --enable-static --enable-cli --disable-cgi --enable-mysqlnd --with-mysqli --with-curl --with-zlib --enable-mbstring --enable-calendar --with-gd --with-bz2 --enable-sockets --enable-ftp --with-gettext --with-xmlrpc --with-xsl --with-pdo-mysql --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-mcrypt --enable-soap --with-openssl --enable-intl --with-layout=GNU

make

and then I got the php binary from:

Code:
/usr/ports/lang/php71/work/php-7.1.32/sapi/cli
 
Why are you building a statically linked version in the first place? What problem are you trying to solve?
 
Τhe main OS uses PHP 7.2, and I have 2 jails with PHP 7.1 and 5.6. And I want to run a magento php script from console using PHP 7.1 without jexec to the jail.
 
Back
Top