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=archivephp: ‘PHP Deprecated: Function utf8_encode() is deprecated in /path-to-matomo/example.com/public_html/vendor/szymach/c-pchart/constants.php on line 48 {“idarchives”:[23261],“nb_visits”:4}’
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-12&format=json&trigger=archivephp: ‘PHP Deprecated: Function utf8_encode() is deprecated in /path-to-matomo/example.com/public_html/vendor/szymach/c-pchart/constants.php on line 48 {“idarchives”:[22581],“nb_visits”:29}’
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-11&format=json&trigger=archivephp: ‘PHP Deprecated: Function utf8_encode() is deprecated in /path-to-matomo/example.com/public_html/vendor/szymach/c-pchart/constants.php on line 48 {“idarchives”:[20181],“nb_visits”:6}’
ERROR [2022-12-13 19:05:16] 28748 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=2&period=week&date=2022-12-12&format=json&trigger=archivephp: ‘PHP Deprecated: Function utf8_encode() is deprecated in /path-to-matomo/example.com/public_html/vendor/szymach/c-pchart/constants.php on line 48 {“idarchives”:[23266],“nb_visits”:33}’
[Exception]
62 total errors during this script execution, please investigate and try and fix these errors.
INFO [2022-12-13 20:47:35] 24415 Error: Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=26&period=month&date=2022-12-01&format=json&trigger=archivephp: ‘PHP Deprecated: Function utf8_encode() is deprecated in /home/roguevalleymedia/domains/analytics.roguevalleymedia.com/public_html/vendor/szymach/c-pchart/constants.php on line 48 {“idarchives”:[23501],“nb_visits”:24}’
update-alternatives --config php - to select the php version I am using worked for me ! Cronjob and Webversion where different - now they are the same again.
PHP Deprecated: Function utf8_encode() is deprecated in /data/www/piwik/vendor/szymach/c-pchart/constants.php on line 48
ERROR [2022-12-16 07:31:02] 3202 Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2022-12-16&format=json&trigger=archivephp: 'PHP Deprecated: Function utf8_encode() is deprecated in …
Seems to be a problem in
/* Euro symbol for GD fonts */
define(“EURO_SYMBOL”, utf8_encode("& # 8364;"));
Maybe this will help if utf8_encode is really needed
/* Euro symbol for GD fonts */
define(“EURO_SYMBOL”, mb_convert_encoding(’& # 8364;’, ‘UTF-8’, ‘ISO-8859-1’));
Sorry, as i wrote “& # 8364” without spaces in my post the € sign was displayed. So i have added spaces betwenn “& # 8”. This should actually be removed.
After this the cron job appears to run “mostly well” with this new message at the top:
WARNING [2022-12-16 17:50:09] 28480 /path-to-matomo/core/Console.php(135): Deprecated - Callables of the form ["Piwik\Console", "Symfony\Component\Console\Application::doRun"] are deprecated - Matomo 4.13.0 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
WARNING [2022-12-16 17:50:09] 28480 /path-to-matomo/core/CronArchive.php(251): Deprecated - Creation of dynamic property Piwik\CronArchive::$rawLogDao is deprecated - Matomo 4.13.0 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
INFO [2022-12-16 17:50:11] 28480 ---------------------------
Additionally, I see this message in the Matomo backend under Diagnostic | System Check
Errors below may be due to a partial or failed upload of Matomo files.
--> Try to reupload all the Matomo files in BINARY mode. <--
File size mismatch: /path-to-matomo/vendor/szymach/c-pchart/constants.php (expected length: 5999, found: 6005)
I’m sure this has to do with my commenting out line 48.
This seem like a bad way to fix this issue. Better ideas, or a real solution, are appreciated.
Ho, i addded define(“EURO_SYMBOL”, mb_convert_encoding(’€’, ‘UTF-8’, ‘ISO-8859-1’));
and the error is gone. I have the same warnings like you have.
@fun4us - I’m in the US so I don’t know, and cannot recall, that I ever saw the Euro symbol anywhere. That being said I will try your code and see what happens.
When you say you are getting the same warnings do you mean these:
WARNING [2022-12-17 15:31:01] 27533 /data/www/htdocs/piwik/core/Console.php(135): Deprecated - Callables of the form [“Piwik\Console”, “Symfony\Component\Console\Application::doRun”] are deprecated - Matomo 4.13.0 - Please report this message in
WARNING [2022-12-17 15:31:01] 27533 /data/www/htdocs/piwik/core/CronArchive.php(251): Deprecated - Creation of dynamic property Piwik\CronArchive::$rawLogDao is deprecated - Matomo 4.13.0 - Please report this message in the Matomo forums: https:/
I also found the other Error
Unterschiedliche Dateigröße: /data/www/mineralienatlas/htdocs/analyse/piwik/vendor/szymach/c-pchart/constants.php (erwartete Größe: 5999, gefunden: 6083) seems to be because of the changes