• Resolved doni3232

    (@doni3232)


    When I switch from PHP 7.4 to PHP 8.1 I get a Fatal error:
    Fatal error: Declaration of DI\Container::has($name) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool in /wp-content/plugins/matomo/app/vendor/php-di/php-di/src/Container.php on line 210
    If I switch back to PHP 7.4 everything is ok again.
    Or if I delete the “matomo” folder in the plugins under PHP 8.1, everything works as usual.
    Does Matomo not run with PHP 8.1 or is there a workaround or do I just have to wait for an update?
    My System:
    WordPress 6.2.2
    Matomo 4.15.0

Viewing 16 replies (of 16 total)
  • Not an expert at all, and I stumbled into the same issue (while installing matomo 4.15.2 on recent WordPress). The vendor directory is not in line with other vendored dependencies, this is ugly. The source of the conflict in my case is Kadence blocks, which certainly cannot be deactivated (this is the content of the website).

    On the other hand, patching the vendored dependency contained in matomo to respect what is probably a more recent version of Psr\ContainerInterface (i.e. from has($name) to has(string $name) : bool) did the trick (plugin seems to work fine afterwards).

    DLL hell all over again? Sigh.

    Remaining issue is that WooCommerce is then complaining about matomo not being compatible with HPOS tables (activated on purpose on the site). Not sure this is even true, but this is the topics for another thread

Viewing 16 replies (of 16 total)
  • The topic ‘WordPress Fatal error with matomo and php 8.1’ is closed to new replies.