Fatal error matomo latest 5.1 and php8.3

I tried to setup matomo on my own webserver using mariaDB, apache24 and php8.3 all in the latest versions according to matomo’s installation guide with every necessery php extension etc.

But I get this error:

Fatal error: Uncaught Error: Call to undefined function Piwik\filter_var() in /usr/local/www/apache24/data/matomo/core/Url.php:358 Stack trace: #0 /usr/local/www/apache24/data/matomo/core/ExceptionHandler.php(160): Piwik\Url::getRFCValidHostname() #1 /usr/local/www/apache24/data/matomo/core/ExceptionHandler.php(101): Piwik\ExceptionHandler::getErrorResponse(Object(Zend_Db_Adapter_Exception)) #2 /usr/local/www/apache24/data/matomo/core/ExceptionHandler.php(42): Piwik\ExceptionHandler::dieWithHtmlErrorPage(Object(Error)) #3 [internal function]: Piwik\ExceptionHandler::handleException(Object(Error)) #4 {main} thrown in /usr/local/www/apache24/data/matomo/core/Url.php on line 358
Matomo encountered an error: Uncaught Error: Call to undefined function Piwik\filter_var() in /usr/local/www/apache24/data/matomo/core/Url.php:358 Stack trace: #0 /usr/local/www/apache24/data/matomo/core/ExceptionHandler.php(160): Piwik\Url::getRFCValidHostname() #1 /usr/local/www/apache24/data/matomo/core/ExceptionHandler.php(101): Piwik\ExceptionHandler::getErrorResponse(Object(Zend_Db_Adapter_Exception)) #2 /usr/local/www/apache24/data/matomo/core/ExceptionHandler.php(42): Piwik\ExceptionHandler::dieWithHtmlErrorPage(Object(Error)) #3 [internal function]: Piwik\ExceptionHandler::handleException(Object(Error)) #4 {main} thrown (which lead to: Session must be started before any output has been sent to the browser; output started in /0)

It seems like the issue is related to the missing filter_var() function, which is a core PHP function. This function is part of the filter extension in PHP. Although it’s a core extension, it can sometimes be disabled or not installed by default, depending on your server configuration.

Here’s what you can try:

  1. Ensure the filter extension is enabled
    Open your php.ini file and search for the line:
    ;extension=filter

Remove the semicolon (;) at the beginning of the line (if it’s there) to enable the extension, or add the line if it’s missing:
extension=filter

  1. Restart Apache after making changes to your php.ini:
    sudo service apache24 restart

  2. Check PHP extensions: You can also verify that the filter extension is enabled by running:
    php -m | grep filter

If it’s not listed, that means the extension isn’t enabled or installed.

After verifying or enabling the filter extension, try reloading Matomo. Let me know if the issue persists!

1 Like