Author Topic: Kinda the same problem with Imagek, but with PHP Sodium on AlmaLinux 9  (Read 323 times)

0 Members and 1 Guest are viewing this topic.

Offline
*****
Getting a similar error on AlmaLinux 9.4 and CWP 0.9.8.1186 with what is going on with Imagek.

Quote
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:

Quote
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.

Offline
**
Re: Kinda the same problem with Imagek, but with PHP Sodium on AlmaLinux 9
« Reply #1 on: September 07, 2024, 09:19:29 AM »
Hi,

In my opinion you need to compile both extensions from sources and not using packages (RPM).

Offline
*****
Re: Kinda the same problem with Imagek, but with PHP Sodium on AlmaLinux 9
« Reply #2 on: September 07, 2024, 12:27:02 PM »
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?

Offline
*****
Re: Kinda the same problem with Imagek, but with PHP Sodium on AlmaLinux 9
« Reply #3 on: September 07, 2024, 01:04:37 PM »
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.

Offline
**
Re: Kinda the same problem with Imagek, but with PHP Sodium on AlmaLinux 9
« Reply #4 on: September 07, 2024, 02:30:03 PM »
The instructions to compile sodium are the similar to imagic:

Code: [Select]
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:
Code: [Select]
wget -O libsodium-2.0.23,zip https://github.com/jedisct1/libsodium-php/archive/refs/heads/master.zip

Offline
**
Re: Kinda the same problem with Imagek, but with PHP Sodium on AlmaLinux 9
« Reply #5 on: September 07, 2024, 03:36:58 PM »
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.

Offline
*****
Re: Kinda the same problem with Imagek, but with PHP Sodium on AlmaLinux 9
« Reply #6 on: September 07, 2024, 05:24:45 PM »
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.