Piwik error: "Call to undefined function twig_lower_filter()"

Hi,

I’m trying to get Piwik-2.1.0 running on a hand-configured PHP-5.5.10 install (as an alternative PHP setup next to the pre-configured PHP-5.3 that comes with Plesk).

I have configured PHP-5.5.10 with following options:


./configure --prefix /usr/local/lib/php-5.5.10 --with-xsl --with-pdo-mysql --with-mysqli --with-mysql

Yet, my Piwik index page reports following error:


 The following error just broke Piwik (v2.1.0):
 Call to undefined function twig_lower_filter()

Does this indicate a missing PHP extension? Any advice on how this can be solved is much appreciated!

Best,

Ron

I just posted the exact same thing within minutes of you… Hope there is a solution!

Thanks for the report! I created a bug at: Call to undefined function twig_lower_filter() · Issue #4999 · matomo-org/matomo · GitHub

The solution for now is to enabel mbstring extensio in your PHP. Maybe in the next release we can put a fix but I recommend to enable mbstring for now.

Thanks Matt, the only problem is that in my case it is installed, from what I can see this is related to languages?

I’ve enabled some commented out lines of my php.ini and same result when using a higher version of php.

I’m on the latest version of CentOs.

Thanks,

SR

Hi,

Thanks for the suggestion. I have rebuilt PHP with:


./configure --prefix /usr/local/lib/php-5.5.10 --with-xsl --with-pdo-mysql --with-mysqli --with-mysql --enable-mbstring

This produces another error:


The following error just broke Piwik (v2.1.0):

Call to undefined function Piwik\DataAccess\gzcompress()
in
${pathToPiwikInstall}/piwik/core/DataAccess/ArchiveWriter.php line 138

Yet, this seems to happen, too, when I rebuild without the --enable-mbstring option. Strange. Am I missing something?

Best,

Ron

Thanks Matt, the only problem is that in my case it is installed, from what I can see this is related to languages?

Can you try in Git master maybe?

I added mbstring to the list of “required” extensions: https://github.com/piwik/piwik/commit/7b739c2d7847f9f14e993f46df94318f17dd5313

Call to undefined function Piwik\DataAccess\gzcompress()
Is your system check Green in Settings>System check?

because zlib should already be marked as “required” so this error should not happen

Hi,

Is your system check Green in Settings>System check?

because zlib should already be marked as “required” so this error should not happen

Hmm, can’t even get there: all I get is an error page (see screenshot). Do you mean that zlib should be enabled by default in PHP? I’m puzzled by the fact that I didn’t have the error before, but now it remains even if I compile PHP with the options from my first post…

Best,

Ron

Hi,

A nice example of regenerative technology: all of a sudden, Piwik got through, still reporting the undefined gzcompress() function in the widgets. But I could check the system settings, which told me that my PHP version had been configured without zlib. So I could finally try your first suggestion for my original issue (enabling mbstring), and can confirm that Piwik 2.1 runs with following PHP configuration options:


./configure --prefix /usr/local/lib/php-5.5.10 --with-xsl --with-pdo-mysql --with-mysqli --with-mysql --with-zlib --enable-mbstring

Thanks again for the help, Matt!

Ron