Using Selfoss with PHP 8
Has anybody been using, or tried to use, Selfoss on a web server that runs PHP 8? How has your experience been?
I've been using Selfoss for about a year and it's been fine so far. This weekend I tried to migrate it to a new server with upgraded software, something I've done before without any trouble, but this time I encountered some errors.
The biggest difference between the servers is that the old one had PHP 7.4.3 and the new one has PHP 8.0.13. That's why I suspect that PHP 8 is the culprit. But it's certainly possible that the problem lies elsewhere and the PHP upgrade is a coincidence.
Here's what I see when I visit my Selfoss installation's home page on the PHP 8 server:
Internal Server Error
Undefined array key "ERROR"
Internal Server Error
Unknown named parameter $expire [/path/to/selfoss/vendor/bcosca/fatfree-core/base.php:2284]
Strangely, there's no reference to a variable named "$expire" on line 2284 or anywhere else in fatfree-core/base.php. Here's what line 2284 looks like:
call_user_func_array('session_set_cookie_params',$jar);
When I check Apache's error logs, there are dozens of lines that look like this:
[Sun Dec 05 17:03:25.833416 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "DEBUG" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1184
[Sun Dec 05 17:03:25.833434 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "CLI" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1239
[Sun Dec 05 17:03:25.833443 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "AJAX" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1239
[Sun Dec 05 17:03:25.833452 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "HIGHLIGHT" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1240
[Sun Dec 05 17:03:25.833462 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "CLI" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1110
[Sun Dec 05 17:03:25.833470 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "PACKAGE" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1112
[Sun Dec 05 17:03:25.833478 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "XFRAME" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1114
[Sun Dec 05 17:03:25.833490 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "VERB" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1118
[Sun Dec 05 17:03:25.833518 2021] [php:warn] [pid 5850] [client 104.237.193.54:36666] PHP Warning: Undefined array key "HALT" in /home/kermit/websites/selfoss/vendor/bcosca/fatfree-core/base.php on line 1272
I visited the GitHub page for fatfree-core and noticed that there's a newer version than what ships with Selfoss 2.18. Hoping to get lucky, I downloaded fatfree-core 3.7.3 and replaced Selfoss' version with it. This *may have* resulted in some progress, in the sense that the error messages changed. The web page no longer showed Internal Server Error messages; it was devoid of text but had Selfoss' recognizeable checkered background image. Here are the Apache logs that I saw after that:
[Sun Dec 05 17:20:36.115668 2021] [php:notice] [pid 5855] [client 104.237.193.54:36948] Undefined property: helpers\\View::$loggedin
[Sun Dec 05 17:20:36.115725 2021] [php:notice] [pid 5855] [client 104.237.193.54:36948] [templates/home.phtml:145] Base->{closure}()
[Sun Dec 05 17:20:36.115738 2021] [php:notice] [pid 5855] [client 104.237.193.54:36948] [helpers/View.php:94] include()
[Sun Dec 05 17:20:36.115746 2021] [php:notice] [pid 5855] [client 104.237.193.54:36948] [controllers/Index.php:35] helpers\\View->render()
[Sun Dec 05 17:20:36.115754 2021] [php:notice] [pid 5855] [client 104.237.193.54:36948] [index.php:80] Base->run()
I don't really know what to try next, and even if I did, I suspect it'd just lead me deeper down a rabbit hole of error messages. So coming here for help seems like the next step. Has anybody else had success with PHP 8? Anybody seen error messages like these before? Could I have misconfigured something?
Some background on my setup: it's a basic DigitalOcean droplet, so the CPU is shared but I'm in control of what's on the OS. Ubuntu version 20.04.3, Apache version 2.4.41, PHP version 8.0.13. I'm using an SQLite database. I use the droplet for other things, but Selfoss is the arguably the biggest/most complex.