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
:
From my understanding,the error tells me that php-intl
requires icu v75, but I have version v76:
If I try downgrading to v75, Im blocked, as v76 is required by other apps:
13 Replies
This shows me that intl has been build, however its using an old version of icu
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!
BumpI know it's not filament so you'll struggle for help tbh.
I would personally use good/AI to debug it further.
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
Assume you are using linux?
Yes, arch. I mentioned this at the start 😅
One last bump just in case
Check, is /usr/lib/php/modules/intl.so a sym link?
You might need to update it to point to the new build
So it isnt
If you run:
ldd /usr/lib/php/modules/intl.so
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?
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 symbolsOk 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.
Thank you!