SOLVED [ALTPHP-665] Can't enable libsodium extension with PHP Selector

nullmem

Member
Jan 21, 2018
11
1
3
Austin, TX
cPanel Access Level
Root Administrator
Well, now the PECL libsodium module for alt-php70 and alt-php71 do not work. If you check the libsodium box and save in users cPanel account using the PHP Selector, the module does not load and the box won't stay checked.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Well, now the PECL libsodium module for alt-php70 and alt-php71 do not work. If you check the libsodium box and save in users cPanel account using the PHP Selector, the module does not load and the box won't stay checked.
Can you open a support ticket so we can take a closer look at your system? You can post the ticket number here and we'll update this thread with the outcome.

Thank you.
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
472
113
UK
cPanel Access Level
Root Administrator
2 days ago I reopened my support ticket to Cloudlinux and reported the following:

In WHM ClouudLinux LVE Manager: Selector - the package is marked as "libsodium" for PHP versions 7.0 and 7.1 and "sodium" for PHP version 7.2 and neither are available for PHP 7.3

In the users cPanel Select PHP Version: extensions it is marked as "libsodium" for PHP versions 7.0 and 7.1 and "sodium" for PHP version 7.2 and neither are available for PHP 7.3

Additionally, whilst the /opt/alt/php7*/etc/php.d.all/libsodium.ini files exist for PHP 7.0 and 7.1 with the content as
Code:
; Enable libsodium extension module
extension=sodium.so
for 7.2 the content is the same, but the file is called sodium.ini and there is neither sodium.ini nor libsodium.ini for 7.3

The only version that I can save the "sodium" extension to is for 7.2

Both 7.0 and 7.1 revert to unchecked after saving and then revisiting the selector.

Today I revisited the ticket and, since it was marked as "Awaiting your reply", I asked if there was anything else they needed?

Kate Grechishkina replied (obviously without even bothering to read through the ticket)
If you don't have any outstanding issues or additional questions in this ticket we can mark it as solved.
I give up trying to help anyone - I don't know if its down to cultural differences, or just that every developer is too arrogant to imagine that their code could be wrong, or too proud to accept help from an outsider, but the overall feeling I have from everyone lately has left me with a bad taste and wondering why I bothered !

I hope @cPanelMichael and @nullmem have better luck, and an altogether more gratifying and fruitful experience than I had.

Please feel free to redact, mutilate or simply just delete this post ! I am getting used to taking the time to search, research and write answers and post them in an effort to help another user - only to have the post summarily deleted which, of course, is not at all demoralizing.
 
Last edited:
  • Like
Reactions: nullmem

nullmem

Member
Jan 21, 2018
11
1
3
Austin, TX
cPanel Access Level
Root Administrator
In WHM ClouudLinux LVE Manager: Selector - the package is marked as "libsodium" for PHP versions 7.0 and 7.1 and "sodium" for PHP version 7.2 and neither are available for PHP 7.3

In the users cPanel Select PHP Version: extensions it is marked as "libsodium" for PHP versions 7.0 and 7.1 and "sodium" for PHP version 7.2 and neither are available for PHP 7.3
On all my servers, I also have exactly the same result of not being able to enable libsodium(PECL module) on 7.0 & 7.1. However, for some reason my sodium(native PHP module) on 7.3 does work. Maybe someone I will have better luck with my ticket.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

To update, CloudLinux case number ALTPHP-665 is now open to address the issue where it's not possible to enable the libsodium extension via PHP Selector for PHP 7.x versions. I'll monitor this case and respond to this thread once it's solved.

In the meantime, the temporary workaround is to copy libsodium.ini to sodium.ini for the affected PHP versions and then run the cagefsctl --update command. For example, with PHP 7.1:

Code:
cp -av /opt/alt/php71/etc/php.d.all/libsodium.ini /opt/alt/php71/etc/php.d.all/sodium.ini
mv /opt/alt/php71/etc/php.d.all/libsodium.ini /opt/alt/php71/etc/php.d.all/libsodium.ini.backup
cagefsctl --update
Thank you.
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
472
113
UK
cPanel Access Level
Root Administrator
In the meantime, the temporary workaround is to copy over the libsodium.ini file to the sodium.ini file for affected PHP versions.
I think that one should also delete or rename the libsodium.ini file to something like libsodium.ini.bak and then force an update of CageFS Skeleton

Just copying the sodium.ini file will leave the libsodium option available in both the LVE Manager and the users cPanel Select PHP Version, and it won't enable sodium if checked and will confuse end users..

The new sodium option seems to work in all the PHP7.x versions and shows in a phpinfo()
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @rpvw,

Thanks, I've updated the workaround instructions.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

To update, CloudLinux published the solution to this issue to their stable repo today:

Alt-PHP updated

Thank you.
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
472
113
UK
cPanel Access Level
Root Administrator
This keeps getting better :(

After the alt-php update today I find the following:

alt-php 70:
libsodioum.ini using libsodium.so > links to sodium.so
and
sodium.ini using sodium.so

alt-php 71:
libsodioum.ini using libsodium.so > links to sodium.so
and
sodium.ini using sodium.so

alt-php 72:
sodium.ini using sodium.so

alt-php 73:
sodium.ini using sodium.so

Does anyone know which .ini and .so files should be used for PHP 7.0 and 7.1 now ? or are the 7.2 and 7.3 missing libraries now ?

UPDATE (Amended above as well)

It seems that for alt-php 7.0 and 7.1 the libsodium.so file is a symlink to the corresponding sodium.so file

I would like to be able to get rid of the duplicated (lib)sodium entries for alt-php 7.0 and 7.1, but I should like to be sure that I delete the correct ones, and what exactly CloudLinux will use as the default in future updates, or I may be going round in circles (not an uncommon state I find myself in these days :confused: )
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @rpvw,

I setup a new CloudLinux 7 test server running cPanel & WHM version 76, enabled CageFS, enabled PHP Selector, and installed the libsodium PECL module for AltPHP versions 7.0, 7.1, and 7.2 using WHM >> Module Installers >> PHP Pecl.

Here's a look at the default files setup in each /opt/alt/php$$/etc/php.d.all/ directory after performing this action:

Code:
# pwd
/opt/alt/php70/etc/php.d.all
# ls -al|grep sodium
-rw-r--r--  1 root root        59 Dec 25 13:39 libsodium.ini
# cat libsodium.ini
; Enable libsodium extension module
extension=libsodium.so

Code:
# pwd
/opt/alt/php71/etc/php.d.all
# ls -al|grep sodium
-rw-r--r--  1 root root        59 Dec 25 13:48 libsodium.ini
# cat libsodium.ini
; Enable libsodium extension module
extension=libsodium.so
Code:
# pwd
/opt/alt/php72/etc/php.d.all
# ls -al|grep sodium
-rw-r--r--  1 root linksafe    53 Dec 24 06:45 sodium.ini
# cat sodium.ini
; Enable sodium extension module
extension=sodium.so
Is this the information you are seeking? If not, can you let me know which specific installation steps to use?

Thank you.
 

rpvw

Well-Known Member
Jul 18, 2013
1,100
472
113
UK
cPanel Access Level
Root Administrator
Thanks @cPanelMichael

That looks like 70 and 71 are using the libsodium modules and 72 and probably 73 are using the sodium modules as far as the LVE Manager and selector are concerned (It doesn't actually matter as they all appear to link or symlink to sodium.so anyway.

I'm going to try deleting the sodium.ini files I created for 70 and 71 and see what breaks in the next alt-php update :-D