How do I fix the error “missing MySQL extension which is required by WordPress” in Matomo for WordPress?
You are viewing the Matomo System Report in Matomo for WordPress and as part of the "Matomo Logs"
section you are seeing some long HTML output where it also says "Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
(In German the message might be like "Deine PHP-Installation scheint nicht über die von WordPress benötigte MySQL-Erweiterung zu verfügen."
).
Additionally, in the section "Matomo: Optional checks"
you are seeing something like "Supports Async Archiving: Yes"
.
This can happen when Matomo is trying to archive reports in the background using the CLI (command line interface) but your PHP is not configured to have MySQL available when the CLI is used. This may be the case because PHP can be configured differently for the web and cli.
The solution is usually to disable the usage of background report generation and instead force the archiving using a web request. In most cases this does not have any disadvantage for users. You can do this by adding below line to your “wp-config.php”
define('MATOMO_SUPPORT_ASYNC_ARCHIVING', false);
Alternatively, you may ask your system administrator or hoster whether they can enable the Mysqli extension for PHP-CLI.