Observium CE 22.5 should fully support php 8.1

But you need by first upgrade Observium to latest, than php.
If you get these errors, you didn't update correctly CE.

Mark Kamichoff via observium wrote on 5.06.2022 22:01:
Hi - 

I had a happy persona/home Observium CE 19.x install on Debian (testing) running w/MySQL 5.5 and PHP 7.0 that I finally decided to upgrade to MariaDB 10.6 / PHP 8.1 and am running into some issues.

1) I did the PHP 8.1 upgrade first without touching anything else.  I started getting the following:

% /opt/observium/discovery.php -u
PHP Fatal error:  Uncaught ValueError: mysqli_query(): Argument #2 ($query) cannot be empty in /opt/observium/includes/db/mysqli.inc.php:291
Stack trace:
#0 /opt/observium/includes/db/mysqli.inc.php(291): mysqli_query()
#1 /opt/observium/includes/db.inc.php(225): dbCallQuery()
#2 /opt/observium/includes/sql-config.inc.php(97): dbQuery()
#3 /opt/observium/discovery.php(19): include('...')
#4 {main}
  thrown in /opt/observium/includes/db/mysqli.inc.php on line 291

I get something similar in the web interface:

[Sun Jun 05 14:59:53.435049 2022] [php:error] [pid 3255678] [client 2620:6:2003:105:2d8:61ff:fe0f:853:54778] PHP Fatal error:  Uncaught ValueError: mysqli_query(): Argument #2 ($query) cannot be empty in /opt/observium/includes/db/mysqli.inc.php:291\nStack trace:\n#0 /opt/observium/includes/db/mysqli.inc.php(291): mysqli_query()\n#1 /opt/observium/includes/db.inc.php(225): dbCallQuery()\n#2 /opt/observium/includes/db/mysqli.inc.php(391): dbQuery()\n#3 /opt/observium/includes/common.inc.php(176): dbFetchRow()\n#4 /opt/observium/includes/common.inc.php(300): get_obs_attrib()\n#5 /opt/observium/includes/sql-config.inc.php(75): get_db_version()\n#6 /opt/observium/html/index.php(13): include('...')\n#7 {main}\n  thrown in /opt/observium/includes/db/mysqli.inc.php on line 291

2) I decided to upgrade to Observium CE 22.5.  No change.  I even cleaned up my config.php and removed some obsolete items.
3) I upgraded MySQL 5.5 -> MariaDB 10.6.  No change.

The CE 22.5 announcement indicated PHP8 should be supported now.  However, I'm wondering if that doesn't include PHP 8.1.

Does anyone have CE 22.5 running successfully on Debian with PHP 8.1?  If so, did you have to tweak anything to get it to work?  If there's something obvious in the docs I've missed please just post a link and indicate RTFM ;)

Thanks in advance!

Some info:

(atlantis:14:56:EDT)% env php --version
PHP Warning:  PHP Startup: ^(text/|application/xhtml\+xml) (offset=0): unrecognised compile-time option bit(s) in Unknown on line 0
PHP 8.1.5 (cli) (built: Apr 21 2022 09:51:30) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.5, Copyright (c), by Zend Technologies
(atlantis:14:56:EDT)% dpkg -l | grep -i php8   
ii  libapache2-mod-php8.1            8.1.5-1                               amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php8.1                           8.1.5-1                               all          server-side, HTML-embedded scripting language (metapackage)
ii  php8.1-apcu                      5.1.21+4.0.11-7                       amd64        APC User Cache for PHP
ii  php8.1-bcmath                    8.1.5-1                               amd64        Bcmath module for PHP
ii  php8.1-cli                       8.1.5-1                               amd64        command-line interpreter for the PHP scripting language
ii  php8.1-common                    8.1.5-1                               amd64        documentation, examples and common module for PHP
ii  php8.1-curl                      8.1.5-1                               amd64        CURL module for PHP
ii  php8.1-gd                        8.1.5-1                               amd64        GD module for PHP
ii  php8.1-mbstring                  8.1.5-1                               amd64        MBSTRING module for PHP
ii  php8.1-mysql                     8.1.5-1                               amd64        MySQL module for PHP
ii  php8.1-opcache                   8.1.5-1                               amd64        Zend OpCache module for PHP
ii  php8.1-readline                  8.1.5-1                               amd64        readline module for PHP
ii  php8.1-xml                       8.1.5-1                               amd64        DOM, SimpleXML, XML, and XSL module for PHP
(atlantis:14:56:EDT)% dpkg -l | grep -i mariadb
ii  libmariadb3:amd64                1:10.6.7-3                            amd64        MariaDB database client library
ii  mariadb-client-10.6              1:10.6.7-3                            amd64        MariaDB database client binaries
ii  mariadb-client-core-10.6         1:10.6.7-3                            amd64        MariaDB database core client binaries
ii  mariadb-common                   1:10.6.7-3                            all          MariaDB common configuration files
ii  mariadb-server                   1:10.6.7-3                            all          MariaDB database server (metapackage depending on the latest version)
ii  mariadb-server-10.6              1:10.6.7-3                            amd64        MariaDB database server binaries
ii  mariadb-server-core-10.6         1:10.6.7-3                            amd64        MariaDB database core server files
(atlantis:14:56:EDT)% 

- Mark


--
Mike Stupalov,
Discord channel: https://discord.gg/GjpNXKWm8W
Observium Limited, https://observium.org