Short tip: Piwik timeout/memory issues on managed web servers

Recently I stumbled upon various PHP errors while using the free analytics software Piwik:

1PHP Fatal error: Allowed memory size of 2442473628 bytes exhausted (tried to allocate 64 bytes)
3Fatal error: Maximum execution time of 30 seconds exceeded in .../piwik/core/DataTable.php

The solution is quite simple - the memory limit and timeout settings need to altered. As the most managed web servers don't allow accessing the configuration file php.ini it is sufficient to alter the appropriate configuration values in the .htaccess file in the Piwik root directory:

1php_value memory_limit 256M
2php_value max_execution_time 150s

You might need to create this file as it might not be existent.