Wordpress Matomo Standalone Plugin error 500

The Bug:
The ’ Matomo Analytics - Ethical Stats. Powerful Insights.’ plugin does not allow access to ‘Reporting’ and ‘Tag Manager’ even after completing all configuration steps, including disabling Addhandler.
The two pages return an error 500, but no error.log is generated in wp-content despite WP_DEBUG and WP_DEBUG_LOG being defined and set to true.

The System:
Ubuntu 22.04 LTS, Apache2.4.52, MariaDB 15.1, php 8.1.2, Wordpress 6.5.3, Matomo 5.0.6.
Everything running on a virtualbox VM, fresh install as of today. The Wordpress install has not been modified in any way, the only additional installed plugin is the Matomo standalone.

How to reproduce:

  1. Install a new, barebone Wordpress 6.5.3 instance. The exact steps I followed are those you can find googling “install wordpress on ubuntu”, I did so for reproducibility’s sake, the only difference being my use of mariadb over mysql. No direct links because they are not allowed in this website.
  2. Add Matomo’s necessary permissions to the database as seen in Matomo’s troubleshooting FAQs.
  3. Modify wp-config.php to disable AddHandler as seen in Matomo’s troubleshooting FAQs.
  4. Change max_packet_size to 64MB for your database as suggested by Matomo’s diagnostics page
  5. Install Matomo Analytics standalone via the wordpress plugin marketplace.
  6. Enter the plugin options, the Get Started page will show an unspecified error, pic related. Press “Enable tracking now” while you’re at it.
  7. Entering the “Diagnostics” page will still show the warning message, but scrolling the page will show no misconfiguration or error message.

Now when trying to access Reporting or Tag Manager you should receive an error 500.

I have waited over 1 hour for the cronjob to execute after fixing ADDHANDLERS but nothing seems to have changed.

This extremely minimal example was my attempt at debugging this same problem in a proper wordpress install, I have been unsuccessful in understanding the root cause of this issue.

Everything runs on a virtualbox vm in bridged networking mode, spun up from scratch for this test.

Here’s the full system report.

				  # Matomo

* Matomo Plugin Version: 5.0.6
* Config exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/config/config.ini.php" )
* JS Tracker exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/matomo.js" )
* Plugin directories: Yes ([{"pluginsPathAbsolute":"$abs_path\/wp-content\/plugins\/matomo\/plugins","webrootDirRelativeToMatomo":"..\/plugins"}])
* Tmp directory writable: Yes ($abs_path/wp-content/cache/matomo)
* Matomo Version: 5.0.2
* Matomo Blog idSite: 1
* Matomo Install Version: 5.0.6 (Install date: 2024-06-04 13:13:27)
* 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 time: 2024-06-04 13:43:19
* Blog time: 2024-06-04 13:43:19 (Below dates are shown in blog timezone)
* Sync users & sites: Next run: 2024-06-05 13:14:29 (23 hours 31 min) ( Last started: 2024-06-04 13:14:29 (-28 min 50s). Last ended: 2024-06-04 13:14:29 (-28 min 50s). Interval: daily)
* Archive: Next run: 2024-06-04 14:13:31 (30 min 12s) ( Last started: 2024-06-04 13:13:32 (-29 min 47s). Last ended: 2024-06-04 13:13:32 (-29 min 47s). Interval: hourly)
* Update GeoIP DB: Next run: 2024-07-04 13:14:29 (29 days 23 hours) ( Last started: 2024-06-04 13:14:29 (-28 min 50s). Last ended: 2024-06-04 13:14:32 (-28 min 47s). Interval: matomo_monthly)
* Disable AddHandler: Next run: 2024-06-04 14:14:18 (30 min 59s) ( Last started: 2024-06-04 13:43:05 (-14s). Last ended: 2024-06-04 13:43:05 (-14s). Interval: hourly)

## Mandatory checks

* PHP version >= 7.2.5: ok 
* PDO extension: ok 
* PDO\MYSQL extension: ok 
* MYSQLI extension: ok 
* Other required extensions: ok 
* Required functions: ok 
* Required PHP configuration (php.ini): ok 
* Directories with write access: ok 
* Directories with write access for Tag Manager: ok 

## Optional checks

* 64-bit PHP Binary: ok 
* Tracker status: ok 
* Memory limit: ok 
* Time zone: ok 
* Open URL: ok 
* GD > 2.x + FreeType (graphics): ok 
* Other extensions: ok 
* Other functions: ok 
* Filesystem: ok 
* Last Successful Archiving Completion: ok 
* Database abilities: ok 
* Max Packet Size: ok 
* Geolocation: ok 
* Update over HTTPS: ok 
* Mobile Messaging SMS Provider: ok 
* Supports Async Archiving: Yes
* Async Archiving Disabled in Setting: No
* Location provider ID: geoip2php
* Location provider available: Yes
* Location provider working: Yes
* Matomo URL: Yes ($site_url/wp-content/plugins/matomo/app)

## Matomo Settings

* Track mode: default
* Track ecommerce: Yes
* Track codeposition: footer
* Track api endpoint: default
* Track js endpoint: default
* Version history: 5.0.6
* Core version: 5.0.2
* Last tracking settings update: 1717507910
* Last settings update: 1717507910

## Logs

* None: 

# WordPress

* Home URL: $site_url
* Site URL: $site_url
* WordPress Version: 6.5.3
* Number of blogs: 1
* Multisite Enabled: No
* Network Enabled: No
* WP_DEBUG: Yes
* WP_DEBUG_DISPLAY: Yes
* WP_DEBUG_LOG: Yes
* DISABLE_WP_CRON: -
* FORCE_SSL_ADMIN: No
* 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: -
* ALTERNATE_WP_CRON: -
* WP_CRON_LOCK_TIMEOUT: 60
* WP_DISABLE_FATAL_ERROR_HANDLER: -
* MATOMO_SUPPORT_ASYNC_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: /%year%/%monthnum%/%day%/%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/2024/06
* Custom upload_path: 
* Custom upload_url_path: 
* Compatible content directory: Yes
* WP_Filesystem Initialized: Yes

# WordPress Plugins

* Akismet Anti-spam: Spam Protection: 5.3.2
* Hello Dolly: 1.7.2
* Matomo Analytics - Ethical Stats. Powerful Insights.: 5.0.6
* Active Plugins: 1 (matomo:5.0.6)
* Theme: twentytwentyfour (twentytwentyfour)

# Server

* Server Info: Apache/2.4.52 (Ubuntu)
* PHP OS: Linux
* PHP Version: 8.1.2-1ubuntu2.17
* PHP SAPI: apache2handler
* PHP Maxmind DB extension: Not loaded
* PHP Error Reporting: 4437 After bootstrap: 4437
* PHP Found Binary: /usr/bin/php -q
* Timezone: UTC
* WP timezone: +00:00
* Locale: en_US
* User Locale: en_US
* Memory Limit: 256M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
* WP Memory Limit: 40M
* WP Max Memory Limit: 256M
* Timezone version: 0.system
* Time: 1717508599
* Max Execution Time: 30
* Max Post Size: 8M
* Max Upload Size: 2097152
* Max Input Vars: 1000
* Disabled PHP functions: No
* zlib.output_compression is off: Yes
* Curl Version: 7.81.0, OpenSSL/3.0.2
* Suhosin installed: No

# PHP cli

* PHP cli Version: 8.1.2-1ubuntu2.17
* MySQLi support: ok
* PHP CLI configuration: Configured correctly

# Database

* MySQL Version: 5.5.5
* Mysqli Connect: Yes
* Force MySQL over Mysqli: No
* DB Prefix: wp_
* DB CHARSET: utf8
* DB COLLATE: 
* SHOW ERRORS: No
* SUPPRESS ERRORS: No
* Uses Socket: No
* Uses IPv6: No
* Matomo tables found: 50
* DB tables exist: Yes
* Matomo users found: 1
* Matomo sites found: 1
* Required permissions: OK

# Browser

* Browser:  (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0)
* Language: en-us,en

	

Thanks for your time.

The reason matomo threw a 500 error was, indeed, AddHandler.
In my virtualhost for the WP website I had AllowOverride limited to a few fields, namely “Limit Options FileInfo”, as that is the default behavior of a new WP install. Adding “AuthConfig” to this list allowed matomo to work properly.
The diagnostics page still shows a warning, this seems to not be effecting the plugin’s functionality.
Issue resolved.

1 Like