Current version can support php8?

Current version can support php8?

Not currently. There are a couple of required changes to get things working, and then a decision will need to be made regarding handling of undefined array keys, etc., which now generate warnings that flood the event log.

yeah this endless isset() bullshit is simply not going to happen.

nothing is gained by this, it’s just noise that makes things hard to read.

tt-rss can now run under PHP 8, but be aware you’ll currently get a whole lot of event/error log noise (mostly “Undefined array key”). It might be worth staying on an older version for a while longer.

I just updated my Arch Linux’s PHP to version 8 and tt-rss (based on commit eb896f824) has stopped working.

I see following text in systemd’s journal:

Jan 28 13:00:27 foo.lan nginx[1543]: 2021/01/28 13:00:27 [error] 1543#1543: *5 upstream sent too big header while reading response header from upstream, client: 192.168.1.111, server: brest.lan, request: “GET /tt-rss/ HTTP/1.1”, upstream: "fastcgi://unix:/run/php-fpm/php>
Jan 28 13:00:27 foo.lan nginx[1543]: 2021/01/28 13:00:27 [error] 1543#1543: *5 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $_SESSION in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13PHP message: PHP Warning: Trying to access array>
Jan 28 13:00:25 foo.lan nginx[1543]: 2021/01/28 13:00:25 [error] 1543#1543: *5 upstream sent too big header while reading response header from upstream, client: 192.168.1.111, server: brest.lan, request: “GET /tt-rss/ HTTP/1.1”, upstream: "fastcgi://unix:/run/php-fpm/php>
Jan 28 13:00:25 foo.lan nginx[1543]: 2021/01/28 13:00:25 [error] 1543#1543: *5 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $_SESSION in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13PHP message: PHP Warning: Trying to access array>
J

My /var/log/php-fpm.log looks like

[28-Dec-2015 00:00:01] NOTICE: error log file re-opened
[02-Jan-2016 00:52:55] NOTICE: Terminating …
[02-Jan-2016 00:52:55] NOTICE: exiting, bye-bye!
[02-Jan-2016 19:03:28] NOTICE: fpm is running, pid 325
[02-Jan-2016 19:03:28] NOTICE: ready to handle connections
[02-Jan-2016 19:03:28] NOTICE: systemd monitor interval set to 10000ms
[02-Jan-2016 19:20:41] NOTICE: Terminating …
[02-Jan-2016 19:20:41] NOTICE: exiting, bye-bye!

And the webpage receives the standard nging error page: “An error occurred. Sorry, the page you are looking for is currently unavailable.
Please try again later.”.

Is it a known issue?

And here is the Arch bug report FS#69462 : [tt-rss] Doesn't work after latest php 8.0.1 update

Here are the warnings from tt-rss feed updater:

Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Undefined variable $_SESSION in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Trying to access array offset on value of type null in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Undefined variable $_SESSION in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Trying to access array offset on value of type null in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Array to string conversion in /usr/share/webapps/tt-rss/include/errorhandler.php on line 24
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Undefined variable $_SESSION in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Trying to access array offset on value of type null in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Array to string conversion in /usr/share/webapps/tt-rss/include/errorhandler.php on line 24
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Undefined variable $_SESSION in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Jan 28 13:21:57 foo.lan php[2423]: PHP Warning: Trying to access array offset on value of type null in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13

:face_with_raised_eyebrow:

lmao

/20char-etc-etc-etc

https://archlinux.org/news/php-80-and-php-7-legacy-packages-are-available/
:kissing_heart:

Apparently even using PHP7 packages do not solve this issue:

Feb 02 09:08:56 my.server.domain php7[482459]: PHP Warning: Undefined variable $_SESSION in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13
Feb 02 09:08:56 my.server.domain php7[482459]: PHP Warning: Trying to access array offset on value of type null in /usr/share/webapps/tt-rss/classes/logger/sql.php on line 13

I’m using php 7.3 without any issues.

PHP 7.3.26 (cli) (built: Jan 11 2021 13:40:15) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.26, Copyright (c) 1998-2018 Zend Technologies

$ grep "PHP Warning" /var/log/messages                                                            
$

If you still have the php8 packages installed, either uninstall them or keep in mind that any php stuff that doesn’t have a 7 as the suffix is for php8 and not 7. So, make sure that you are using /usr/bin/php7 as your php cli path and are using php7-fpm as your fpm service.

here’s an initial branch for php8-alpine dynamic docker image:

https://git.tt-rss.org/fox/ttrss-docker-compose/commit/c1ad9507972f0c4248f481968ba4f29469ccbd15

like already said above, it works but there are many warnings. not sure about possible ways to fix this while keeping code readable.

  • array_key_exists or isset possibly in a wrapper - function call overhead (we’re not talking highload here but still, i don’t like pointless overhead), ugly
  • ?? operator - forces source to be php7+, ugly but maybe less ugly

ideas welcome.

references:

so far ?? operator seems to be the only viable way forward, sometimes it even improves readability.

inb4 >my shared hosting still uses php 5

e:

:thinking:

In case anyone has the same issue, my problem was I hadn’t changed the definition of PHP_EXECUTABLE in the config file.