iftechfoundation / ifdb-suggestion-tracker

Bugs and feature requests for a future IFDB update
10 stars 0 forks source link

Upgrade to PHP 8 #411

Open dfabulich opened 9 months ago

dfabulich commented 9 months ago

Some day, we're going to have to upgrade from Debian 11 Bullseye to Debian 12 Bookworm. That's going to be tricky, because Debian 12 comes with PHP 8, and the site doesn't work on PHP 8.

I have a branch here https://github.com/iftechfoundation/ifdb/tree/php-8 but when you try to start the site that way, the home page fails to load:

PHP Fatal error:  Uncaught Error: Call to undefined function get_magic_quotes_gpc() in /var/www/html/util.php:313\nStack trace:\n#0 /var/www/html/home(29): get_req_data()\n#1 {main}\n  thrown in /var/www/html/util.php on line 313

https://www.php.net/manual/en/function.get-magic-quotes-gpc.php

[!WARNING] This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly > discouraged

In my experience upgrading other sites from PHP 7 to PHP 8, this upgrade is going to be a doozy.

salty-horse commented 9 months ago

I'll mess around with it. get_magic_quotes_gpc function always returns false, since its associated feature was deprecated several versions back.

Here's the official migration guide: https://www.php.net/manual/en/migration80.php

salty-horse commented 9 months ago

One interesting change is that the mysqi error level now defaults to MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT, which raises exceptions in the development environment when the storage database is missing.

I'll wrap that function with an off/on call, but perhaps we want to turn strict reporting off altogether. Will see if I encounter it again.