PHP 8 & 8.1 not tracking

I’m running Matomo 4.9.1 and when I use PHP 8 or 8.1 visitors are not getting tracked and I get a console error. When I downgrade the server to PHP 7.4 things are tracking fine. Any ideas?

Can you share the console error?
Do you have access to Matomo log file (and check the error server-side)?
Maybe you have this plugin installed:

it may give you some clues…

Philippe I see the following in my Apache Error Log file on the server

  • AH01630: client denied by server configuration: /matomo/vendor/phpunit

  • AH01630: client denied by server configuration: /matomo/config/global.ini.php

  • AH01630: client denied by server configuration: /matomo/tmp/

  • AH00529: /matomo/tmp/cache/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/matomo/tmp/cache/’ is executable

  • Uncaught Error: Call to undefined function ignore_user_abort() in /matomo/piwik.php:15\nStack trace:\n#0 /matomo/matomo.php(13): include()\n#1 {main}\n thrown in /matomo/piwik.php on line 15’

These seem to be the most seen errors in the error log and I see all of the above multiple times over the last 5 days. I don’t see anything in the log files even though they are enabled because it appears as though the logs are being denied by the current configuration.

This might be the reason why it doesn’t work as this is one of the first lines of code that Matomo executes:

But I have no idea why it fails for you as ignore_user_abort should be available everywhere and even if it wasn’t the @ should avoid the error.

2 Likes

Thanks for the reply I have corrected that error in the server but I still get the same other issues popping up again and again. Any ideas? It is these error messages over and over again:

[Sat May 14 18:44:55.324487 2022] [authz_core:error] [pid 1245:tid 140341789247232] [client 149.28.240.57:0] AH01630: client denied by server configuration: /matomo/config/global.ini.php
[Sat May 14 18:44:54.271478 2022] [authz_core:error] [pid 1246:tid 140341764134656] [client 149.28.240.57:0] AH01630: client denied by server configuration: /matomo/lang/en.json
[Sat May 14 18:44:54.255006 2022] [authz_core:error] [pid 1247:tid 140342033729280] [client 149.28.240.57:0] AH01630: client denied by server configuration: /matomo/tmp/empty
[Sat May 14 18:44:54.238618 2022] [authz_core:error] [pid 1247:tid 140341822818048] [client 149.28.240.57:0] AH01630: client denied by server configuration: /matomo/tmp/
[Sat May 14 18:44:54.221427 2022] [core:crit] [pid 1246:tid 140341931923200] (13)Permission denied: [client 149.28.240.57:0] AH00529: /matomo/tmp/cache/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/matomo/tmp/cache/' is executable

The other errors (“client denied by server configuration”) are not errors, but instead tell you that Apache blocked access to /config/global.ini.php as it should.
The request is probably coming from the Matomo system check which tests if the file is private as it should be.

Thanks Lukas. I appreciate it. It appears as though once the ignore user issue was fixed on the server PHP 8.1 is working properly I will keep you up to date if this no longer is the case

I currently have the same problem.

ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] Uncaught exception: Error: Call to undefined function Piwik\ignore_user_abort() in /home/mario/webapps/eamatomo/core/Http.php:1019
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] Stack trace:
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #0 /home/mario/webapps/eamatomo/plugins/RssWidget/RssRenderer.php(60): Piwik\Http::fetchRemoteFile()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #1 /home/mario/webapps/eamatomo/plugins/RssWidget/Widgets/RssPiwik.php(37): Piwik\Plugins\RssWidget\RssRenderer->get()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #2 /home/mario/webapps/eamatomo/plugins/RssWidget/Widgets/RssPiwik.php(43): Piwik\Plugins\RssWidget\Widgets\RssPiwik->getFeed()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #3 /home/mario/webapps/eamatomo/plugins/CoreHome/Controller.php(92): Piwik\Plugins\RssWidget\Widgets\RssPiwik->render()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #4 [internal function]: Piwik\Plugins\CoreHome\Controller->renderWidget()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #5 /home/mario/webapps/eamatomo/core/FrontController.php(637): call_user_func_array()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #6 /home/mario/webapps/eamatomo/core/FrontController.php(169): Piwik\FrontController->doDispatch()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #7 /home/mario/webapps/eamatomo/core/dispatch.php(32): Piwik\FrontController->dispatch()
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #8 /home/mario/webapps/eamatomo/index.php(25): require_once('...')
ERROR Piwik\FrontController[2024-02-18 19:13:01 UTC] [e93af] #9 {main}

At the moment I have reverted to php 7.4. What do I have to do to make the tracking work with php 8.1?

Hi @electricarts,
Old versions of Matomo may not support recent versions of PHP (as these PHP versions did not exist at the time of old Matomo versions… :wink: )
Then I suggest you migrate first to Matomo 4.16, then update the PHP version.