A fatal error occurred v4.2.0: Illegal length modifier specified 'f' in s[np]printf call

Hi,

It would be great if you would like to get to the source of this issue. Very few people report it, but still it has been reported before:

I personally think this isn’t a bug in Matomo or even in Twig, but rather a bug in your PHP version.

This is the line of code that the error message says:

As you can see it includes no kind of call to *printf, so there can’t be an illegal modifier passed to it.

But I wouldn’t be surprised if the C code that implements file_put_contents and rename do internally use printf in a way that breaks in exactly your environment and in exactly the way Matomo uses it (as I can find few references to it outside Matomo on the internet).

My recommendation would be to upgrade your PHP to the latest patch version (so the y in 7.x.y) and see if it still occurs.