Troubleshooting PHP 5.3.0 with intl support

I'm currently trying to install PHP 5.3.0 on some kind of Linux testing server. Since we were urgently waiting for ext / intl, we want to check the provided functions. I successfully execute configurewith the following arguments

./configure
    --with-apxs2=/usr/local/apache2/bin/apxs
    --prefix=/usr/local/php
    --with-zlib-dir=/usr/local/zlib
    --with-imap=/.../imap-2006k
    --with-imap-ssl
    --with-openssl=shared
    --with-iconv=shared
    --with-zlib=shared
    --with-curl=shared
    --with-curlwrappers
    --enable-exif
    --with-ldap=shared,/usr/local/openldap
    --with-ldap-sasl
    --enable-mbstring=shared
    --with-mcrypt
    --enable-soap=shared
    --enable-sockets
    --enable-zip=shared
    --enable-pdo=shared
    --with-pdo-sqlite=shared
    --with-sqlite=shared
    --with-mysql=shared,/usr/local/mysql
    --with-pdo-mysql=shared,/usr/local/mysql
    --with-mysqli=shared,/usr/local/mysql/bin/mysql_config
    --with-mhash=shared,/usr/local/mhash
    --with-libxml-dir=/usr/local/libxml2
    --with-xsl=shared,/usr/local/libxslt
    --enable-xmlreader=shared
    --enable-xmlwriter=shared
    --with-gmp=shared
    --with-icu-dir=/usr/local/icu
    --enable-intl

ICU 4.2 is located in /usr/local/icu, and PHP 5.2.9 compiled flawlessly (without the int and icu options). But when I fix the source code of PHP 5.3.0, I get a lot of error messages like

ext/intl/grapheme/.libs/grapheme_util.o(.text+0xbab):/.../php-5.3.0/ext/intl/grapheme/grapheme_util.c:208: undefined reference to `ubrk_close_4_2'

I am quite sure that this is due to the fact that you do not find shared libraries. Installation

export LD_LIBRARY_PATH=/usr/local/icu/lib

Does not help.

Can someone point me to some solution? I am pretty ignorant - and I'm not very good at these things ...

EDIT:

, icu- - /usr/local/icu/lib:

lrwxrwxrwx  1 root root       20 Jul  1 09:56 libicudata.so -> libicudata.so.42.0.1
lrwxrwxrwx  1 root root       20 Jul  1 09:56 libicudata.so.42 -> libicudata.so.42.0.1
-rw-r--r--  1 root root 16015140 Jul  1 09:56 libicudata.so.42.0.1
lrwxrwxrwx  1 root root       20 Jul  1 09:56 libicui18n.so -> libicui18n.so.42.0.1
lrwxrwxrwx  1 root root       20 Jul  1 09:56 libicui18n.so.42 -> libicui18n.so.42.0.1
-rwxr-xr-x  1 root root  2454770 Jul  1 09:56 libicui18n.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicuio.so -> libicuio.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicuio.so.42 -> libicuio.so.42.0.1
-rwxr-xr-x  1 root root    65299 Jul  1 09:56 libicuio.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicule.so -> libicule.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicule.so.42 -> libicule.so.42.0.1
-rwxr-xr-x  1 root root   356125 Jul  1 09:56 libicule.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libiculx.so -> libiculx.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libiculx.so.42 -> libiculx.so.42.0.1
-rwxr-xr-x  1 root root    75110 Jul  1 09:56 libiculx.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicutu.so -> libicutu.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicutu.so.42 -> libicutu.so.42.0.1
-rwxr-xr-x  1 root root   159330 Jul  1 09:56 libicutu.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicuuc.so -> libicuuc.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicuuc.so.42 -> libicuuc.so.42.0.1
-rwxr-xr-x  1 root root  1660769 Jul  1 09:56 libicuuc.so.42.0.1

make check - :

[All tests passed successfully...]
Elapsed Time: 00:00:25.000
make[2]: Leaving directory `/.../icu-4.2/source/test/cintltst'
---------------
ALL TESTS SUMMARY:
All tests OK:  testdata intltest iotest cintltst
make[1]: Leaving directory `/.../icu-4.2/source/test'
make[1]: Entering directory `/.../icu-4.2/source'
verifying that icu-config --selfcheck can operate
verifying that make -f Makefile.inc selfcheck can operate
PASS: config selfcheck OK
make[1]: Leaving directory `/.../icu-4.2/source'

EDIT: VolkerK questions

ICU 4.2 , , , .

/usr/local/icu/bin/icu-config --version
4.2.0.1

/usr/local/icu/bin/icu-config --prefix
/usr/local/icu

/usr/local/icu/bin/icu-config --cppflags-searchpath
-I/usr/local/icu/include

/usr/local/icu/bin/icu-config --ldflags --ldflags-icuio
-lpthread -lm   -L/usr/local/icu/lib -licui18n -licuuc -licudata  -lpthread -lm   -licuio

objdump -C /usr/local/icu/lib/libicuuc.so.42.0.1
// doesn't work because of unrecognized argument -C

EDIT VolkerK:

, - . objdump /usr/local/icu/lib/libicuuc.so.42.0.1 ,

objdump -t /usr/local/icu/lib/libicuuc.so.42.0.1 | grep ubrk_close
00000000000d2484 g     F .text  000000000000002d              ubrk_close_4_2

, .

VolkerK edit1 edit2:

, - icu- sytem; , (, icu-config, /usr/local/icu/bin).

gcc -lpthread -lm -L/usr/local/icu/lib -licui18n -licuuc -licudata -lpthread -lm -licuio -print-file-name=libicuuc.so

/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/../../../../lib64/libicuuc.so

while gcc -lpthread -lm -L/usr/local/icu/lib -licui18n -licuuc -licudata -lpthread -lm -licuio -print-file-name=libicuuc.so.42

libicuuc.so.42

, , lib- ? , - .

- undefined, , , PHP .

icu- lib- icu-library?

+5
3

, ( ) .
, , . , Linux. , , , / .
() . . /configure, - . , .

icu 4-2? php intl (ext/intl/grapheme/grapheme_string.c)

#include <unicode/ubrk.h>
...
PHP_FUNCTION(grapheme_substr)
{
   ...
   ubrk_close(bi);
   ...

. grapheme_string.c , icu 3.4 icu 4.2. ubrk_close_4_2?
"./configure... --with-icu-dir =/usr/local/icu", ext/intl/config.m4. icu-config , include , php. icu, ,

ICU_CONFIG="$PHP_ICU_DIR/bin/icu-config"
ICU_INCS=`$ICU_CONFIG --cppflags-searchpath`
ICU_LIBS=`$ICU_CONFIG --ldflags --ldflags-icuio`

. icu-config, , , , , ICU_INCS ICU_LIBS . ICU_INCS ICU_LIBS gcc, /. gcc (apperently) unicode/ubrk.h , , ICU_INCS, , icu 4.2 . unicode/ubrk.h unicode/utypes.h, unicode/urename.h - icu 4.2. unicode/urename.h #define ubrk_close ubrk_close_4_2.
, ubrk_close (bi) ubrk_close_4_2 (bi).

PHP_FUNCTION(grapheme_substr)
{
   ...
   ubrk_close_4_2(bi);
   ...

, ubrk_close_4_2, - .
, . icu 4.2 . .
. ICU_LIBS

-lpthread -lm -L/usr/local/icu/lib -licui18n -licuuc -licudata -lpthread -lm -licuio

-licuuc gcc " icuuc ". gcc LIB , "icuuc".
libicuuc.so. , , , libicuuc.so. , . gcc . - , gcc. .

gcc -L/usr/lib -L/usr/local/lib -licuuc

/usr/lib/libicuuc.so, , /usr/local/lib/libicuuc.so(). , , .
, "" , ( ).
, , (runtime) loader ( ), .
"" ( ) , ( SONAME) . , .

lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicuuc.so -> libicuuc.so.42.0.1
lrwxrwxrwx  1 root root       18 Jul  1 09:56 libicuuc.so.42 -> libicuuc.so.42.0.1
-rwxr-xr-x  1 root root  1660769 Jul  1 09:56 libicuuc.so.42.0.1

libicuuc.so, gcc , -licuuc. libicuuc.so.42.0.1. "" , (runtime) libicuuc.so.42, . http://userguide.icu-project.org/packaging#TOC-ICU-Versions.
libicuuc.so.42.0.1, libicuuc.so.42.0.2, libicuuc.so.42.0.3, libicuuc.so.42. libicuuc.so.42 / , icu 4.2. /, . , gcc libicuuc.so- > libicuuc.so.42.0.1, () libicuuc.so- > libicuuc.so.34.x.y. libicuuc.so.34.x.y icu 4.2, ubrk_close_4_2, ubrk_close_3_4. , ubrk_close_4_2 → .

"" (): . /configure , ... Makefile.
Makefile ( ) , INTL_SHARED_LIBADD =

-licui18n -licuuc -licudata -licuio

/usr/local/icu/lib/libicui18n.so.42/usr/local/icu/lib/libicuuc.so.42/usr/local/icu/lib/libicudata.so.42/usr/local//Library/libicuio.so.42

( -lm -pthread... ). .
"" gcc/linker .so, . , (beacuse of SONAME).
, . /configure, .

: libicuXY.so( " " ), libicuXY.so- > libicuXY.so.42.0.1. libicuuc.so → gt; libicuuc.so.34.x.y, gcc/linker .
- SONAME, , , "" ( ) libicuXY.so.34.
, .. , include, -. ( ) .

+6

export LD_LIBRARY_PATH=/usr/local/icu/lib

. , , ICU, , . :

export LD_LIBRARY_PATH=/usr/local/icu/lib:${LD_LIBRARY_PATH}

, , :

  • ? , , /usr/local/lib/icu?
  • ? " " . / , ICU, ICU. (PPT) .

, . , php-intl libicu 3.6 3.8. googled Linux php-intl, libicu 3.8, libicu 4.0 . , intl php, .

libicu 3.8 .

0

, ld , . LD_LIBRARY_PATH ( ), ldconfig .

:

  • /usr/local/lib /usr/lib
  • /etc/ld.so.conf run/sbin/ldconfig

, ldconfig , ldconfig , /usr/local/icu/lib . ​​/usr/local/lib/icu, ldconfig , , LD .

I recommend just reinstalling the library in / usr / local / lib and running ldconfig before changing ld.so.conf, however changing this file is not a big ban if you just want it to work.

0
source

All Articles