PHP Startup: Unable to load dynamic library 'intl'

Full error: PHP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib/php/modules/intl (/usr/lib/php/modules/intl: cannot open shared object file: No such file or directory), /usr/lib/php/modules/intl.so (libicuio.so.75: cannot open shared object file: No such file or directory)) in Unknown on line 0 Im using Arch Linux, and after updating to php 8.4.x Im getting this error when using the intl extension. This is the same issue as in here but unlike that post Im not using WSL. To begin with, the php-intl package has been replaced by php 8.4.x. So, when trying to install it, it will try to install php:
~  pacman -Qi php-intl
Installed From : cachyos-v3
Name : php
Version : 8.4.3-2
Description : A general-purpose scripting language that is especially suited to web development
Architecture : x86_64_v3
URL : https://www.php.net/
Licenses : PHP-3.01
Groups : None
Provides : php-interpreter=8.4 php-intl=8.4.3
Depends On : libxml2 curl libzip pcre2 argon2 oniguruma
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : php-intl
Replaces : php-intl
~  pacman -Qi php-intl
Installed From : cachyos-v3
Name : php
Version : 8.4.3-2
Description : A general-purpose scripting language that is especially suited to web development
Architecture : x86_64_v3
URL : https://www.php.net/
Licenses : PHP-3.01
Groups : None
Provides : php-interpreter=8.4 php-intl=8.4.3
Depends On : libxml2 curl libzip pcre2 argon2 oniguruma
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : php-intl
Replaces : php-intl
From my understanding,the error tells me that php-intl requires icu v75, but I have version v76:
~  pacman -Qi icu
Installed From : cachyos-core-v3
Name : icu
Version : 76.1-1.1
...
~  pacman -Qi icu
Installed From : cachyos-core-v3
Name : icu
Version : 76.1-1.1
...
If I try downgrading to v75, Im blocked, as v76 is required by other apps:
error: failed to prepare transaction (could not satisfy dependencies)
:: installing icu (75.1-2) breaks dependency 'libicuuc.so=76-64' required by harfbuzz-icu
:: installing icu (75.1-2) breaks dependency 'libicuuc.so=76-64' required by raptor
:: installing icu (75.1-2) breaks dependency 'libicui18n.so=76-64' required by thunderbird
:: installing icu (75.1-2) breaks dependency 'libicuuc.so=76-64' required by thunderbird
error: failed to prepare transaction (could not satisfy dependencies)
:: installing icu (75.1-2) breaks dependency 'libicuuc.so=76-64' required by harfbuzz-icu
:: installing icu (75.1-2) breaks dependency 'libicuuc.so=76-64' required by raptor
:: installing icu (75.1-2) breaks dependency 'libicui18n.so=76-64' required by thunderbird
:: installing icu (75.1-2) breaks dependency 'libicuuc.so=76-64' required by thunderbird
13 Replies
Matthew
MatthewOP2mo ago
This shows me that intl has been build, however its using an old version of icu
pacman -Ql php | grep "intl"
php /usr/lib/php/modules/intl.so
pacman -Ql php | grep "intl"
php /usr/lib/php/modules/intl.so
This error appears when enabling the intl extension in the php.ini file. However, if I dont enable it, then I just get the The "intl" PHP extension is required to use the [format] method. My final conclusion is that I somehow have to manually build intl.so with icu v76 instead of v75. However, Im not sure how I can do that. Maybe there is a simpler fix? Thanks! Bump
toeknee
toeknee2mo ago
I know it's not filament so you'll struggle for help tbh. I would personally use good/AI to debug it further.
Matthew
MatthewOP2mo ago
I know, but AI is just stuck in a loop 😅. I already tried debugging for hours, but couldnt solve it. Thats why Im here xD Im giving as much information as I can
toeknee
toeknee2mo ago
Assume you are using linux?
Matthew
MatthewOP2mo ago
Yes, arch. I mentioned this at the start 😅 One last bump just in case
toeknee
toeknee2mo ago
Check, is /usr/lib/php/modules/intl.so a sym link? You might need to update it to point to the new build
Matthew
MatthewOP2mo ago
~  ls -l /usr/lib/php/modules/intl.so
-rwxr-xr-x 1 root root 633048 12 feb 21:11 /usr/lib/php/modules/intl.so
~  ls -l /usr/lib/php/modules/intl.so
-rwxr-xr-x 1 root root 633048 12 feb 21:11 /usr/lib/php/modules/intl.so
So it isnt
toeknee
toeknee2mo ago
If you run: ldd /usr/lib/php/modules/intl.so
Matthew
MatthewOP2mo ago
~  ldd /usr/lib/php/modules/intl.so  ✔
linux-vdso.so.1 (0x00007e04ad359000)
libicuio.so.75 => not found
libicui18n.so.75 => not found
libicuuc.so.75 => not found
libicudata.so.75 => not found
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007e04ace00000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007e04ad1b4000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007e04ad182000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007e04acc00000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007e04ad35b000)
~  ldd /usr/lib/php/modules/intl.so  ✔
linux-vdso.so.1 (0x00007e04ad359000)
libicuio.so.75 => not found
libicui18n.so.75 => not found
libicuuc.so.75 => not found
libicudata.so.75 => not found
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007e04ace00000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007e04ad1b4000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007e04ad182000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007e04acc00000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007e04ad35b000)
toeknee
toeknee2mo ago
libicuio.so.75 => not found libicui18n.so.75 => not found libicuuc.so.75 => not found libicudata.so.75 => not found are your issues, you could try symlinks to resolve the dependacy issue sudo ln -sf /usr/lib/libicuio.so.76 /usr/lib/libicuio.so.75 sudo ln -sf /usr/lib/libicui18n.so.76 /usr/lib/libicui18n.so.75 sudo ln -sf /usr/lib/libicuuc.so.76 /usr/lib/libicuuc.so.75 sudo ln -sf /usr/lib/libicudata.so.76 /usr/lib/libicudata.so.75 then restart php-fpm or httpd?
Matthew
MatthewOP2mo ago
Nice! But this created another error: PHP Warning: PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/lib/php/modules/intl (/usr/lib/php/modules/intl: cannot open shared object file: No such file or directory), /usr/lib/php/modules/intl.so (/usr/lib/php/modules/intl.so: undefined symbol: _ZTIN6icu_7517StringEnumerationE)) in Unknown on line 0 Maybe because intl.so was compiled with icu 75, but now its using icu 76 that has different symbols
toeknee
toeknee2mo ago
Ok so remove those sym links sudo rm /usr/lib/libicuio.so.75 sudo rm /usr/lib/libicui18n.so.75 sudo rm /usr/lib/libicuuc.so.75 sudo rm /usr/lib/libicudata.so.75 Then install php-intl trying to trick pacman sudo pacman -S php-intl --assume-installed php=8.3.0 Otherwise build it manually: git clone https://github.com/php/php-src.git cd php-src git checkout PHP-8.4.3 cd ext/intl phpize ./configure make sudo cp modules/intl.so /usr/lib/php/modules/
GitHub
GitHub - php/php-src: The PHP Interpreter
The PHP Interpreter. Contribute to php/php-src development by creating an account on GitHub.
Matthew
MatthewOP2mo ago
Thank you!

Did you find this page helpful?