I am using Matomo 4.13.0 and updated to php 8.2.0 this week. These are warnings on the core files.
I am attaching a screen shot since each warning contains a link. Just saw that last warning is a duplicate of the first warning, sorry.
PHP 8.2 is not supported yet by Matomo:
opened 03:05PM - 12 Jun 22 UTC
closed 02:24PM - 18 Jan 23 UTC
Task
Help wanted
The first alpha of PHP 8.2 has been released and I got a bit of time, so I will … be looking into what the major things are that will cause current Matomo to break when using PHP 8.2.
See also #17686 for 8.1
Reading through [UPGRADING](https://github.com/php/php-src/blob/php-8.2.0alpha1/UPGRADING), I don't see any major breaking changes, but we will see what needs to be changed.
As only the first reported issue here seems to completely brake Matomo and with it fixed, the majority of Matomo is already working fine, I will only list one example per deprecated usage here and link to more information about the deprecation.
--------------
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /home/lukas/public_html/matomophp8/core/testMinimumPhpVersion.php on line 130
See https://wiki.php.net/rfc/deprecate_dollar_brace_string_interpolation
https://github.com/matomo-org/matomo/pull/19344 (there are also a few more occurances in tests)
------------------
WARNING [2022-06-12 15:26:34] 188990 /home/lukas/public_html/matomophp8/plugins/PrivacyManager/DoNotTrackHeaderChecker.php(29): Deprecated - Creation of dynamic property Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker::$config is deprecated - Matomo 4.11.0-rc1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
I assume this will affect a lot of code, but also it should be really easy to detect with PHPStorm or PHP_CS:
https://wiki.php.net/rfc/deprecate_dynamic_properties
https://php.watch/versions/8.2/dynamic-properties-deprecated
`https://github.com/squizlabs/PHP_CodeSniffer/issues/3489`
And getting rid of such cases might make the code more readable and especially avoid bugs because of typos.
--------------
WARNING [2022-06-12 15:26:35] 188990 /home/lukas/public_html/matomophp8/core/Console.php(135): Deprecated - Callables of the form ["Piwik\Console", "Symfony\Component\Console\Application::doRun"] are deprecated - Matomo 4.11.0-rc1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
https://github.com/matomo-org/matomo/blob/e3218471244d08039b1b84f1c907f1be0e018768/core/Console.php#L135
https://wiki.php.net/rfc/deprecate_partially_supported_callables
https://php.watch/versions/8.2/partially-supported-callable-deprecation
-------------
To be updated...
The same issue was also recently reported here:
Matomo V 4.13.0
MySQL version: 10.3.36-MariaDB-0+deb10u2
PHP version: 8.1.13
Since a recent PHP update we are now getting these errors after cron runs every hour:
PHP Deprecated: Function utf8_encode() is deprecated in /path-to-matomo/example.com/public_html/vendor/szymach/c-pchart/constants.php on line 48
ERROR [2022-12-13 19:05:12] 28748 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=2&period=day&date=2022-12-13&format=json&trigger…
Best to downgrade to PHP 8.1 in the meantime.
Thanks GermanKiwi, most of the functionality and reports that I use are still working so I do not have any problem waiting for the update.
@GermanKiwi - I am already on PHP 8.1. It shows that in the report (PHP 8.1.13).
Hi John, I think you’re commenting on the wrong thread. This thread was started by Jim and he’s reporting an error after updating to PHP 8.2. I included a link to your thread in my reply to Jim above.
@GermanKiwi - Ok, sorry about that.
I was/am still getting the errors. As a bad, and hopefully temporary, fix I remmed out line 48 in constants.php.
That’s certainly strange. I got similar errors after I upgraded to PHP 8.2, and I then downgraded back to 8.1. The errors continued (from my cron job) for several more hours before finally stopping.