Page MenuHomeDevCentral

Install intl PHP extension everywhere
Closed, ResolvedPublic

Description

rNOTIF added dependency to rKOT, and that highlighted the fact the intl extension is missing from our PHP stack.

This extension offers the grapheme_* as a more correct alternative to mbstring_* and support for international domain names.

Event Timeline

dereckson renamed this task from Install intl extension to Install intl PHP extension everywhere.Mar 31 2023, 17:48
dereckson triaged this task as High priority.
dereckson updated the task description. (Show Details)

For shellserver and devserver role, the intl extension is already installed, per bdd61c48. MediaWiki is quoted as example of application using it.

Debian images will lag too much, review https://icu.unicode.org/download, we're at 71, Debian Bullseye is stuck at 67.

Let's build it.

"Fun" fact: libxml requires libicu, and pulls the system one of course:

#0 515.4 /usr/bin/ld: warning: libicuuc.so.67, needed by /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libxml2.so, may conflict with libicuuc.so.71
#0 515.4 /usr/bin/ld: warning: libicuuc.so.67, needed by /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libxml2.so, may conflict with libicuuc.so.71
#0 515.4 /usr/bin/ld: warning: libicuuc.so.67, needed by /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libxml2.so, may conflict with libicuuc.so.71

So if we want a custom libicu, we're stuck with setting LD_LIBRARY_PATH.

And even with that:

#0 516.4 Generating phar.php
#0 516.5 /usr/src/php/sapi/cli/php: error while loading shared libraries: libicudata.so.71: cannot open shared object file: No such file or directory
#0 516.5 make: *** [Makefile:468: ext/phar/phar.php] Error 127
`

The library path used was /usr/local/lib/icu.

We can't use more recent Sid packages, they depends of more recent version of other libs.

If someone wants to revisit issue:

Dockerfile
&& wget -O /usr/src/libicu.tar.gz https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-src.tgz \
&& wget -O /usr/src/libicu.tar.gz.asc https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-src.tgz.asc \
&& gpg --verify /usr/src/libicu.tar.gz.asc \
&& mkdir /usr/src/libicu \
&& cd /usr/src/libicu \
&& tar xzf ../libicu.tar.gz --strip-components=1 \
&& cd source && ./configure --prefix=/usr/local && make && make install \

For now, back to icu 67.

So if someone needs more recent ICU, the cleaner way would be a custom Bullseye build of the icu source package. We'll include it in packages.nasqueron.org, and from there, the repository can then be used in the image both for libxml2 and PHP itself.

dereckson moved this task from Backlog to Working on on the Notifications center board.

The nasqueron/notifications image took from D2958, so we're done:

docker-002
$ docker exec -it notifications php -i | grep ICU
ICU version => 67.1
ICU Data version => 67.1
ICU Unicode version => 13.0
[…]