WordPress Fatal error with matomo and php 8.1
-
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
-
Hello @doni3232 You may have an incompatible plugin.
Can you share with us your system report available from the menu Matomo Analytics > Diagnostics ?And why is the same system running with the same plugins with PHP 7.4? I can't get to the Matomo menu because I only see the wordpress error message under PHP 8.1. Here are the plugins used: accordion-shortcodes block-bad-queries custom-fields-gutenberg easy-fancybox events-manager gt3-photo-video-gallery media-library-assistant nextend-smart-slider3-pro updraftplus wpfront-scroll-top admin-menu-tree-page-view contact-form-7 custom-post-type-ui editor-full-width ewww-image-optimizer mediavine-create stops-core-theme-and-plugin-updates uploads wp-optimize autoptimize contact-form-7-image-captcha disable-gutenberg-autosave editor-menu-and-widget-access formidable kadence-blocks modula-best-grid-gallery survey-maker wordfence wp-pagebuilder aweos-google-maps-iframe-load-per-click custom-content-shortcode duplicate-post essential-blocks gdpr-cookie-compliance lazy-blocks mystickymenu templately wordpress-seo
Hello @doni3232 Thanks for sending us the list of your plugins. Everything seems to be okay as I don’t see anything from this list Which plugins is Matomo for WordPress known to be not compatible with?
Could you please send us a copy of your system check report by going to Matomo Analytics > Diagnostics. This way we can investigate further?Sorry, the report is in german, online with PHP 7.4:
* Matomo-Plugin-Version: 4.15.0 * Config existiert und ist schreibbar.: Ja ("$abs_path/wp-content/uploads/matomo/config/config.ini.php" ) * JS Tracker existiert und ist schreibbar.: Ja ("$abs_path/wp-content/uploads/matomo/matomo.js" ) * Plugin-Verzeichnisse: Yes ([{"pluginsPathAbsolute":"$abs_path\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/"}]) * Tmp-Verzeichnis schreibbar: Yes ($abs_path/wp-content/cache/matomo) * Matomo-Version: 4.15.0 * Matomo Blog idSite: 1 * Installierte Matomo-Version: No * Upgrades outstanding: No * Upgrade in progress: No ## Endpoints * Matomo JavaScript Tracker URL: ($site_url/wp-content/uploads/matomo/matomo.js) * Matomo JavaScript Tracker - WP Rest API: ($site_url/wp-json/matomo/v1/hit/) * Matomo HTTP Tracking API: ($site_url/wp-content/plugins/matomo/app/matomo.php) * Matomo HTTP Tracking API - WP Rest API: ($site_url/wp-json/matomo/v1/hit/) ## Crons * Server-Zeit: 2023-08-03 04:47:34 * Blog-Zeit: 2023-08-03 06:47:34 (Die nachfolgenden Daten werden in der Blog-Zeitzone angezeigt) * Sync users & sites: Next run: 2023-08-03 09:33:13 (2 Stunden 45 Minuten) ( Last started: 2023-08-02 09:33:41 (-21 Stunden 13 Minuten). Last ended: 2023-08-02 09:33:41 (-21 Stunden 13 Minuten). Interval: daily) * Archive: Next run: 2023-08-03 06:49:44 (2 Minuten 10s) ( Last started: 2023-08-03 05:51:55 (-55 Minuten 39s). Last ended: 2023-08-03 05:52:15 (-55 Minuten 19s). Interval: hourly) * Update GeoIP DB: Next run: 2023-08-10 09:33:17 (7 Tage 2 Stunden) ( Last started: 2023-07-11 09:35:28 (-22 Tage 21 Stunden). Last ended: 2023-07-11 09:35:30 (-22 Tage 21 Stunden). Interval: matomo_monthly) ## Vorgeschriebene Prüfungen * PHP-Version >= 7.2.5: ok * PDO Erweiterung: ok * PDO\MYSQL Erweiterung: ok * MYSQLI Erweiterung: ok * Weitere erforderliche Anforderungen: ok * Erforderliche Funktionen: ok * Ben?tigte PHP Konfiguration (php.ini): ok * Verzeichnisse mit Schreibzugriff: ok * Verzeichnisse mit Schreibzugriff auf Tag Manager: ok ## Optionale Prüfungen * 64-bit PHP Bin?r: ok * Tracker-Status: ok * Speicherlimit: ok * Zeitzone: ok * ?ffnen einer URL: ok * GD > 2.x + FreeType (Grafiken): ok * Andere Erweiterungen: ok * Andere Funktionen: ok * Dateisystem: ok * Letzter erfolgreicher Abschluss der Archivierung: ok * Datenbankf?higkeiten: ok * Maximale Packetgr??e: ok * Standorterkennung: ok * Update über HTTPS: ok * Supports Async Archiving: No * Location provider ID: geoip2php * Location provider available: Yes * Location provider working: Yes * Had visit in last 5 days: Yes * Matomo URL: Yes ($site_url/wp-content/plugins/matomo/app/) ## Matomo Settings * Track mode: disabled * Track codeposition: header * Track api endpoint: default * Track js endpoint: default * Version history: 4.15.0, 4.13.3, 4.10.0, 4.6.0, 4.5.0 * Core version: 4.15.0 * Last tracking settings update: 1671024871 * Last settings update: 1671024871 * Track noscript: Yes * Show get started page: 0 ## Logs * Keine: # WordPress * Home URL: $site_url * Site URL: $site_url * WordPress Version: 6.2.2 * Number of blogs: 1 * Multisite Enabled: No * Network Enabled: No * WP_DEBUG: No * WP_DEBUG_DISPLAY: Yes * WP_DEBUG_LOG: No * DISABLE_WP_CRON: - * FORCE_SSL_ADMIN: Yes * WP_CACHE: No * CONCATENATE_SCRIPTS: - * COMPRESS_SCRIPTS: - * COMPRESS_CSS: - * ENFORCE_GZIP: - * WP_LOCAL_DEV: - * WP_CONTENT_URL: $site_url/wp-content * WP_CONTENT_DIR: $abs_path/wp-content * UPLOADS: - * BLOGUPLOADDIR: - * DIEONDBERROR: - * WPLANG: de_DE * ALTERNATE_WP_CRON: - * WP_CRON_LOCK_TIMEOUT: 60 * WP_DISABLE_FATAL_ERROR_HANDLER: - * MATOMO_SUPPORT_ASYNC_ARCHIVING: - * MATOMO_TRIGGER_BROWSER_ARCHIVING: - * MATOMO_ENABLE_TAG_MANAGER: - * MATOMO_SUPPRESS_DB_ERRORS: - * MATOMO_ENABLE_AUTO_UPGRADE: - * MATOMO_DEBUG: - * MATOMO_SAFE_MODE: - * MATOMO_GLOBAL_UPLOAD_DIR: - * MATOMO_LOGIN_REDIRECT: - * Permalink Structure: /%postname%/ * Possibly uses symlink: No * Upload base url: $site_url/wp-content/uploads * Upload base dir: $abs_path/wp-content/uploads * Upload url: $site_url/wp-content/uploads/2023/08 * Custom upload_path: * Custom upload_url_path: * Compatible content directory: Yes # WordPress Plugins * Accordion Shortcodes: 2.4.2 * Admin Menu Tree Page View: 2.8.4 * Autoptimize: 3.1.8.1 * AWEOS Google Maps iframe Load per Click: 1.9 * BBQ Firewall: 20230718 * Contact Form 7: 5.7.7 * Contact Form 7 Image Captcha: 3.3.5 * Create by Mediavine: 1.9.4 * Custom Content Shortcode: 4.0.2 * Custom Fields for Gutenberg: 2.3.7 * Custom Post Type UI: 1.13.7 * Disable Gutenberg Autosave: 1.0.11 * Easy FancyBox: 1.9.5 * Easy Updates Manager: 9.0.16 (Network enabled) * Editor Full Width Gutenberg: 1.0.5 * Editor Menu and Widget Access: 3.1.2 * Essential Blocks: 4.1.5 * Events Manager: 6.4.4 * EWWW Image Optimizer: 7.2.0 * Formidable Forms: 6.4 * GDPR Cookie Compliance: 4.12.4 * GT3 Photo & Video Gallery - Lite: 2.7.7.17 * Kadence Blocks – Gutenberg Blocks for Page Builder Features: 3.0.41 * Lazy Blocks: 3.4.4 * Matomo Analytics - Ethical Stats. Powerful Insights.: 4.15.0 * Media Library Assistant: 3.09 * Modula: 2.7.4 * myStickymenu: 2.6.4 * Smart Slider 3 Pro: 3.5.1.17 * Survey Maker: 7.1.3 * Templately: 2.2.2 * UpdraftPlus - Backup/Restore: 1.23.7 * Wordfence Security: 7.10.3 (Network enabled) * WP-Optimize - Clean, Compress, Cache: 3.2.16 * WPFront Scroll Top: 2.0.7.08086 * WP Page Builder: 1.2.8 * WP Recipe Maker: 8.9.2 * Yoast Duplicate Post: 4.5 * Yoast SEO: 20.12 * Active Plugins: 38 (accordion-shortcodes admin-menu-tree-page-view autoptimize aweos-google-maps-iframe-load-per-click block-bad-queries contact-form-7-image-captcha contact-form-7 custom-content-shortcode custom-fields-gutenberg custom-post-type-ui disable-gutenberg-autosave duplicate-post easy-fancybox editor-full-width editor-menu-and-widget-access essential-blocks events-manager ewww-image-optimizer formidable gdpr-cookie-compliance gt3-photo-video-gallery kadence-blocks lazy-blocks matomo media-library-assistant mediavine-create modula-best-grid-gallery mystickymenu nextend-smart-slider3-pro stops-core-theme-and-plugin-updates survey-maker templately updraftplus wordfence wordpress-seo wp-optimize wp-pagebuilder wpfront-scroll-top) * Theme: twentysixteen (twentysixteen-child) # Server * Server Info: Apache * Apache AddHandler support: Supported * PHP OS: Linux * PHP Version: 7.4.33 * PHP SAPI: fpm-fcgi * PHP Binary Name: /usr/sbin/php74-fpm * PHP Maxmind DB extension: Not loaded * PHP Error Reporting: After bootstrap: 0 * PHP Found Binary: /usr/bin/php -q * Timezone: UTC * WP timezone: Europe/Berlin * Locale: de_DE * User Locale: de_DE * Memory Limit: 512M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.) * WP Memory Limit: 40M * WP Max Memory Limit: 512M * Timezone version: 0.system * Time: 1691038055 * Max Execution Time: 30 * Max Post Size: 200M * Max Upload Size: 209715200 * Max Input Vars: 3000 * Disabled PHP functions: No * zlib.output_compression is off: Yes * Curl Version: 7.58.0, OpenSSL/1.1.1 * Suhosin installed: No # PHP cli * PHP cli Version: 7.2.34-nmm7 * MySQLi support: ok # Database * MySQL Version: 5.7.37 * Mysqli Connect: Yes * Force MySQL over Mysqli: No * DB Prefix: wp_ * DB CHARSET: utf8mb4 * DB COLLATE: * SHOW ERRORS: No * SUPPRESS ERRORS: No * Uses Socket: No * Uses IPv6: No * Matomo tables found: 193 * DB tables exist: Yes * Matomo users found: 3 * Matomo sites found: 1 * Erforderliche Berechtigungen: OK # Browser * Browser: (Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0) * Language: de,en-us,en
im having the same issue, php 8.1 & 8.2 are going full fatal, aka. white screen of death (backend):
[03-Aug-2023 09:36:16 UTC] PHP Fatal error: Declaration of Piwik\Plugins\WordPress\Logger::emergency($message, array $context = []) must be compatible with Psr\Log\AbstractLogger::emergency(Stringable|string $message, array $context = []): void in […]/wp-content/plugins/matomo/plugins/WordPress/Logger.php on line 95
removing the matomo plugin brings the backend back up.
- This reply was modified 1 year, 3 months ago by jnz31.
@doni3232 Thank you for sending a copy of your system check report. This might be a possible bug. I do apologize if we can’t provide a solution for this at the moment. However, I have escalated this and created a new issue in our tracker and you can follow our progress here:?https://github.com/matomo-org/matomo-for-wordpress/issues/831
@jnz31 Sorry to hear that you’re having issue with Matomo for WordPress plugin.
The most common solution to the message?
Oops... there was a problem during the request.
?is to?setup Auto-Archiving in your Matomo?by following these two steps:
a) Enabling the crontab to run the?core:archive
?command and
b) Disabling “Archive reports when viewed from the browser” in the General Settings.If the error persists, or you’re getting a white screen/page (sometimes called the ‘White screen of death’), it indicates that there is a problem on the server: check in your web server error log file for an error message and send it to us.
I can not find the settings “Archive reports when viewed from the browser” with PHP 7.4, in PHP 8.1 I have a white Screen (in Frontend and Backend).
I can only choose between this:
“Delete old visitor logs and reports”
“Cross-Origin Resource Sharing (CORS) domains”
“Live”
“PrivacyManager”
“TagManager”@emermatomo i did exactly, what u suggested in ur answer to my post: i had the white screen and i posted the error log. something around logging throws fatal
This worked now with Xampp offline.
I disabled the plugin “WP-Optimize – Clean, Compress, Cache”, slug: wp-optimize.
Unfortunately, I can’t do this online because the e-mail marketing tool “phplist” is still running there and there are errors there.@doni3232 @jnz31 I do apologize if I can’t provide a solution on this at the moment. Not to worry though, I have created a bug report on GitHub to notify our developers. You can check the bug report on this link: https://github.com/matomo-org/matomo-for-wordpress/issues/831
If you have any further information or feedback, please leave a comment on the Github issue directly so that our developers can be notified.@emermatomo: thanks for your help!
I have commented this on GitHub.
https://github.com/matomo-org/matomo-for-wordpress/issues/831Thank you for commenting on the GitHub issue @doni3232. I do apologize if we can’t solve the issue via forum.
If you have a different questions, please don’t hesitate to create a topic and we’d be glad to assist.Hello.
It seems I have the same issue.
Une erreur de type E_COMPILE_ERROR a été causée dans la ligne 210 du fichier wp-content/plugins/matomo/app/vendor/php-di/php-di/src/Container.php. Message d’erreur : Declaration of DI\Container::has($name) must be compatible with Psr\Container\ContainerInterface::has(string $id): bool
- This reply was modified 1 year, 3 months ago by Virginie FAVRAT.
@vfavrat This error is related to an incompatible plugin with Matomo for WordPress. Please check the incompatible plugins on this link Which plugins is Matomo for WordPress known to be not compatible with?
- The topic ‘WordPress Fatal error with matomo and php 8.1’ is closed to new replies.