Error installing composer with PHP 8.2

I try to install LibreNMS with instruction in docs install with Ubuntu 20.04 and use apache2. I have problems when i run ./scripts/composer_wrapper.php install --no-dev
this output :

librenms@dnsserver:~$ ./scripts/composer_wrapper.php install --no-dev
> LibreNMS\ComposerHelper::preInstall
Installing dependencies from lock file
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
    - Root composer.json requires php ^7.1.3 but your php version (8.2.11) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires PHP extension ext-curl * but it is missing from your system. Install or enable PHP's curl extension.
  Problem 3
    - Root composer.json requires PHP extension ext-gd * but it is missing from your system. Install or enable PHP's gd extension.
  Problem 4
    - Root composer.json requires PHP extension ext-mbstring * but it is missing from your system. Install or enable PHP's mbstring extension.
  Problem 5
    - Root composer.json requires PHP extension ext-xml * but it is missing from your system. Install or enable PHP's xml extension.
  Problem 6
    - amenadiel/jpgraph is locked to version 3.6.21 and an update of this package was not requested.
    - amenadiel/jpgraph 3.6.21 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
  Problem 7
    - doctrine/cache is locked to version 1.10.0 and an update of this package was not requested.
    - doctrine/cache 1.10.0 requires php ~7.1 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 8
    - doctrine/dbal is locked to version v2.9.3 and an update of this package was not requested.
    - doctrine/dbal v2.9.3 requires php ^7.1 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 9
    - doctrine/event-manager is locked to version 1.1.0 and an update of this package was not requested.
    - doctrine/event-manager 1.1.0 requires php ^7.1 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 10
    - doctrine/inflector is locked to version 1.3.1 and an update of this package was not requested.
    - doctrine/inflector 1.3.1 requires php ^7.1 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 11
    - dragonmantank/cron-expression is locked to version v2.3.0 and an update of this package was not requested.
    - dragonmantank/cron-expression v2.3.0 requires php ^7.0 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 12
    - erusev/parsedown is locked to version 1.7.4 and an update of this package was not requested.
    - erusev/parsedown 1.7.4 requires ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension.
  Problem 13
    - influxdb/influxdb-php is locked to version 1.15.0 and an update of this package was not requested.
    - influxdb/influxdb-php 1.15.0 requires php ^5.5 || ^7.0 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 14
    - laravel/framework is locked to version v5.8.37 and an update of this package was not requested.
    - laravel/framework v5.8.37 requires ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension.
  Problem 15
    - laravel/laravel is locked to version v5.8.35 and an update of this package was not requested.
    - laravel/laravel v5.8.35 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 16
    - martinlindhe/laravel-vue-i18n-generator is locked to version 0.1.46 and an update of this package was not requested.
    - martinlindhe/laravel-vue-i18n-generator 0.1.46 requires ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension.
  Problem 17
    - opis/closure is locked to version 3.5.1 and an update of this package was not requested.
    - opis/closure 3.5.1 requires php ^5.4 || ^7.0 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 18
    - paragonie/random_compat is locked to version v9.99.99 and an update of this package was not requested.
    - paragonie/random_compat v9.99.99 requires php ^7 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 19
    - php-amqplib/php-amqplib is locked to version v2.11.1 and an update of this package was not requested.
    - php-amqplib/php-amqplib v2.11.1 requires ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension.
  Problem 20
    - spatie/laravel-cors is locked to version 1.3.3 and an update of this package was not requested.
    - spatie/laravel-cors 1.3.3 requires php ^7.0 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 21
    - symfony/console is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/console v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 22
    - symfony/css-selector is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/css-selector v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 23
    - symfony/debug is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/debug v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 24
    - symfony/error-handler is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/error-handler v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 25
    - symfony/event-dispatcher is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/event-dispatcher v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 26
    - symfony/event-dispatcher-contracts is locked to version v1.1.7 and an update of this package was not requested.
    - symfony/event-dispatcher-contracts v1.1.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 27
    - symfony/finder is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/finder v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 28
    - symfony/http-foundation is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/http-foundation v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 29
    - symfony/http-kernel is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/http-kernel v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 30
    - symfony/mime is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/mime v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 31
    - symfony/process is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/process v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 32
    - symfony/routing is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/routing v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 33
    - symfony/service-contracts is locked to version v1.1.8 and an update of this package was not requested.
    - symfony/service-contracts v1.1.8 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 34
    - symfony/translation is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/translation v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 35
    - symfony/translation-contracts is locked to version v1.1.7 and an update of this package was not requested.
    - symfony/translation-contracts v1.1.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 36
    - symfony/var-dumper is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/var-dumper v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 37
    - symfony/yaml is locked to version v4.4.7 and an update of this package was not requested.
    - symfony/yaml v4.4.7 requires php ^7.1.3 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 38
    - tijsverkoyen/css-to-inline-styles is locked to version 2.2.2 and an update of this package was not requested.
    - tijsverkoyen/css-to-inline-styles 2.2.2 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 39
    - vlucas/phpdotenv is locked to version v3.6.2 and an update of this package was not requested.
    - vlucas/phpdotenv v3.6.2 requires php ^5.4 || ^7.0 -> your php version (8.2.11) does not satisfy that requirement.
  Problem 40
    - laravel/framework v5.8.37 requires ext-mbstring * -> it is missing from your system. Install or enable PHP's mbstring extension.
    - wpb/string-blade-compiler 3.8.x-dev requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.37].
    - wpb/string-blade-compiler is locked to version 3.8.x-dev and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/8.2/cli/php.ini
    - /etc/php/8.2/cli/conf.d/10-opcache.ini
    - /etc/php/8.2/cli/conf.d/10-pdo.ini
    - /etc/php/8.2/cli/conf.d/20-calendar.ini
    - /etc/php/8.2/cli/conf.d/20-ctype.ini
    - /etc/php/8.2/cli/conf.d/20-exif.ini
    - /etc/php/8.2/cli/conf.d/20-ffi.ini
    - /etc/php/8.2/cli/conf.d/20-fileinfo.ini
    - /etc/php/8.2/cli/conf.d/20-ftp.ini
    - /etc/php/8.2/cli/conf.d/20-gettext.ini
    - /etc/php/8.2/cli/conf.d/20-iconv.ini
    - /etc/php/8.2/cli/conf.d/20-phar.ini
    - /etc/php/8.2/cli/conf.d/20-posix.ini
    - /etc/php/8.2/cli/conf.d/20-readline.ini
    - /etc/php/8.2/cli/conf.d/20-shmop.ini
    - /etc/php/8.2/cli/conf.d/20-sockets.ini
    - /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
    - /etc/php/8.2/cli/conf.d/20-sysvsem.ini
    - /etc/php/8.2/cli/conf.d/20-sysvshm.ini
    - /etc/php/8.2/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-curl --ignore-platform-req=ext-gd --ignore-platform-req=ext-mbstring --ignore-platform-req=ext-xml --ignore-platform-req=ext-dom` to temporarily ignore these required extensions.

Then i think i need to upgrade my PHP version, so i try to run command :

apt install php8.1-cli php8.1-curl php8.1-fpm php8.1-gd php8.1-gmp php8.1-mbstring php8.1-mysql php8.1-snmp php8.1-xml php8.1-zip

This my php version output :

librenms@dnsserver:~$ php -v
PHP 8.2.11 (cli) (built: Oct  6 2023 09:46:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies

And this my output ./validate.php

librenms@dnsserver:~$ ./validate.php
PHP Warning:  include(Illuminate/Support/Str.php): Failed to open stream: No such file or directory in /opt/librenms/validate.php on line 71
PHP Warning:  include(): Failed opening 'Illuminate/Support/Str.php' for inclusion (include_path='.:/usr/share/php') in /opt/librenms/validate.php on line 71
PHP Fatal error:  Uncaught Error: Class "Illuminate\Support\Str" not found in /opt/librenms/LibreNMS/Config.php:129
Stack trace:
#0 /opt/librenms/LibreNMS/Util/Git.php(34): LibreNMS\Config::get()
#1 /opt/librenms/LibreNMS/Util/Version.php(40): LibreNMS\Util\Git::repoPresent()
#2 /opt/librenms/LibreNMS/Util/Version.php(45): LibreNMS\Util\Version->__construct()
#3 /opt/librenms/includes/common.php(987): LibreNMS\Util\Version::get()
#4 /opt/librenms/validate.php(73): version_info()
#5 [internal function]: {closure}()
#6 {main}
  thrown in /opt/librenms/LibreNMS/Config.php on line 129
[FAIL]  config.php does not exist, please copy config.php.default to config.php

Warning: include(Illuminate/Support/Str.php): Failed to open stream: No such file or directory in /opt/librenms/validate.php on line 71

Warning: include(): Failed opening 'Illuminate/Support/Str.php' for inclusion (include_path='.:/usr/share/php') in /opt/librenms/validate.php on line 71

Fatal error: Uncaught Error: Class "Illuminate\Support\Str" not found in /opt/librenms/LibreNMS/Config.php:129
Stack trace:
#0 /opt/librenms/LibreNMS/Util/Git.php(34): LibreNMS\Config::get()
#1 /opt/librenms/LibreNMS/Util/Version.php(40): LibreNMS\Util\Git::repoPresent()
#2 /opt/librenms/LibreNMS/Util/Version.php(45): LibreNMS\Util\Version->__construct()
#3 /opt/librenms/includes/common.php(987): LibreNMS\Util\Version::get()
#4 /opt/librenms/validate.php(73): version_info()
#5 [internal function]: {closure}()
#6 {main}
  thrown in /opt/librenms/LibreNMS/Config.php on line 129

Anyone have a solution for this problems, please ?

Make sure you have installed all php dependencies and probably uninstall old php versions.

PHP 8.2 works great.

Component Version
LibreNMS 23.9.1-91-gfcfaded91f (2023-10-14T15:29:13-05:00)
DB Schema 2023_10_07_231037_application_metrics_add_primary_key (263)
PHP 8.2.11
Python 3.11.5
Database MariaDB 11.1.2-MariaDB
RRDTool 1.8.0
SNMP 5.9.1

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.