Php 8.1 error in INSTALL PHP EXTENSIONS

Hello someone can help me I followed your pasts and there everything is fine I have installed zip.so, but now the script that I am installing requires this module sodium extension I have tried everything but I can not solve the problem …

here are the logs of what script installed


[root@vmi310028 public_html]# /usr/local/lsws/lsphp81/bin/pecl install  libsodium libsodium-devel
pecl/libsodium requires PHP (version >= 7.0.0, version <= 8.0.99), installed version is 8.1.4
No valid packages found
install failed


[root@server public_html]# php -v
PHP 8.1.4 (cli) (built: Oct 25 2022 18:05:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies


[root@server public_html]# composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - lcobucci/jwt is locked to version 4.2.1 and an update of this package was not requested.
    - lcobucci/jwt 4.2.1 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
  Problem 2
    - lcobucci/jwt 4.2.1 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
    - league/oauth2-server 8.3.5 requires lcobucci/jwt ^3.4.6 || ^4.0.4 -> satisfiable by lcobucci/jwt[4.2.1].
    - league/oauth2-server is locked to version 8.3.5 and an update of this package was not requested.

Setup sodium command SSH:  
 /usr/local/lsws/lsphp81/bin/pecl install  libsodium libsodium-devel

/usr/local/lsws/lsphp81/bin/pecl install  libsodium libsodium-devel
pecl/libsodium requires PHP (version >= 7.0.0, version <= 8.0.99), installed version is 8.1.4
No valid packages found
install failed


Thanks Advance!

Welcome @freddyfoxx Happy you are here

I see you are running PHP 8.1.4.

latest version of libsodium wrapper only supports PHP Version: 8.0.99 or older

I always recommend my users not to use PHP > 8 because it is not tried and tested.

What is my next step??

root@vps:~/php-8.1.18# make install
Installing shared extensions:     /usr/local/lsws/lsphp81/lib/php/extensions/no-debug-non-zts-20210902/
Installing PHP CLI binary:        /usr/local/lsws/lsphp81/bin/
Installing PHP CLI man page:      /usr/local/lsws/lsphp81/php/man/man1/
Installing phpdbg binary:         /usr/local/lsws/lsphp81/bin/
Installing phpdbg man page:       /usr/local/lsws/lsphp81/php/man/man1/
Installing PHP CGI binary:        /usr/local/lsws/lsphp81/bin/
Installing PHP CGI man page:      /usr/local/lsws/lsphp81/php/man/man1/
Installing build environment:     /usr/local/lsws/lsphp81/lib/php/build/
Installing header files:          /usr/local/lsws/lsphp81/include/php/
Installing helper programs:       /usr/local/lsws/lsphp81/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/lsws/lsphp81/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lsws/lsphp81/lib/php/
[PEAR] Archive_Tar    - installed: 1.4.14
[PEAR] Console_Getopt - installed: 1.4.3
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util       - installed: 1.4.5
warning: pear/PEAR dependency package "pear/Archive_Tar" installed version 1.4.14 is not the recommended version 1.4.4
[PEAR] PEAR           - installed: 1.10.13
Wrote PEAR system config file at: /usr/local/lsws/lsphp81/etc/pear.conf
You may want to add: /usr/local/lsws/lsphp81/lib/php to your php.ini include_path
/root/php-8.1.18/build/shtool install -c ext/phar/phar.phar /usr/local/lsws/lsphp81/bin/phar.phar
ln -s -f phar.phar /usr/local/lsws/lsphp81/bin/phar
Installing PDO headers:           /usr/local/lsws/lsphp81/include/php/ext/pdo/

If you get a Loading screen or blank screen when compiling, Check this bug. I’m not sure if it is fixed as yet but it may still be there and will be there for 2.3.3:

Make the change and restart the installation and you will be fine.

I aksed another question, what to do next after compilation ?

Follow the steps in this post: Php 8.1 error in INSTALL PHP EXTENSIONS - #24 by quoviz_dev

Then follow this: Php 8.1 error in INSTALL PHP EXTENSIONS - #17 by quoviz_dev

If you’re using CentOS 8 or later, consider using DNF (Dandified YUM) instead of YUM. The commands are similar, but DNF might provide better package management capabilities.

sudo dnf update
sudo dnf install lsphp81 lsphp81-mysqlnd lsphp81-gd lsphp81-process lsphp81-mbstring lsphp81-xml lsphp81-zip lsphp81-pdo lsphp81-imap lsphp81-soap lsphp81-bcmath

If the issue persists within CyberPanel, check the CyberPanel settings and ensure that it recognizes PHP 8.1 correctly. Sometimes, a panel or control panel might require additional configuration to recognize newly installed PHP versions.

CyberPanel requires manual configuration to show the PHP change in the panel it self.
That is why it’s best to only use what comes with CyberPanel, but I do wish that CyberPanel adds the new PHP versions, to be shown if you upgrade.
Not sure it does today.
Only on “new” installs.