Control Web Panel
WebPanel => PHP => Topic started by: Starburst on September 06, 2024, 11:49:35 PM
-
Getting a similar error on AlmaLinux 9.4 and CWP 0.9.8.1186 with what is going on with Imagek.
PHP Warning: PHP Startup: Unable to load dynamic library 'sodium' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/sodium (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/sodium: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20220829/sodium.so (/usr/local/lib/php/extensions/no-debug-non-zts-20220829/sodium.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
The supporting packages are installed:
Package php-sodium-8.0.30-1.el9.x86_64 is already installed.
Package php-pecl-zip-1.19.2-6.el9.x86_64 is already installed.
Wondering if something with the backend PHP compiler isn't broken.
-
Hi,
In my opinion you need to compile both extensions from sources and not using packages (RPM).
-
I installed them after the CWP compiler said they where missing.
What's weird, it's only on this 1 new server. Others are OK.
Shouldn't the CWP backend PHP compiler do this automatically?
But I will try that, and see what happens.
Do you have a quick cheat to compile sodium like Imagek?
-
Well that's annoying...
So apparently is Imagek
It can't reach the required pecl.php.net
So if a ping to the above fails, so will your PHP build.
-
The instructions to compile sodium are the similar to imagic:
dnf install libsodium-devel
cd /usr/local/src/
wget https://pecl.php.net/get/libsodium-2.0.23.tgz
tar -xvzf libsodium-2.0.23.tgz
cd libsodium-2.0.23
/opt/alt/phpXX/usr/bin/phpize
./configure --with-php-config=/opt/alt/phpXX/usr/bin/php-config
make
make install
Make sure "extension=sodium.so" presents in appropriate .ini file.
P.S. if pecl.php.net is inaccessible for some reason, you can download php libsodium from Github:
wget -O libsodium-2.0.23,zip https://github.com/jedisct1/libsodium-php/archive/refs/heads/master.zip
-
Checked this article:
https://wiki.centos-webpanel.com/php-version-switcher
and then files associated with php sodium for EL9. It seems sodium should be compiled by default for php-fpm_selector, php_selector, php_switcher on EL9 systems.
If it wasn't compiled by default then it is better to review /var/log/php-rebuild.log for investigation.
-
It was the firewall blocking pecl.php.net
Unblocked the hacker filled DO network, and it recompiled via selector without problems.
Could be why this and Imagek is random.
DO really needs to clean up their network, or php.net needs to move off it.