Hi guys,
I’m in serious trouble here. I’m trying to set up the archive.php cron job for Piwik 1.7.1. I think I’ve got all I need - except one thing: Enough memory.
Anyways: I’ve got the archive.php running either via php-cli or as an http request including the admin token_auth. In both cases, I run into memory trouble.
The strange thing is: I have a php.ini set up in ~/piwik/ - if I place a tiny phpinfo.php next to it with “<?php phpinfo(); ?>”, I see that the php.ini is parsed, and the “memory_limit=512M” is actually honored. The same is true when running “php -i | grep memory_limit” at the console - I have the 512M.
If I lower this to an insanely low value, I can even make archive.php crash. But if I leave it at the standard value, or if I give it above mentioned 512M, when calling it via http, it reports that it is using 5.4M of memory - nothing serious yet.
However, the small sub-calls fail. As I understand the PHP code, even when run via php-cli, the sub-calls are placed via http (as far as I understand the “$response = Piwik_Http::sendHttpRequestBy(‘curl’ …” in line 486).
Anyways … The request
index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=year&date=last52&format=php&token_auth=****&trigger=archivephp
ie. the last year’s archive calculation fails:
Fatal error: Out of memory (allocated 102236160) (tried to allocate 4096 bytes)
Well – 102236160 is far below 512M, it’s more like 97.5M. headscratch Interestingly enough, my provider’s default value is 70M, so this isn’t the default value either.
I’ve tried a lot.
I noticed that the “memory_limit=…” doesn’t seem to be inherited properly by the sub folders, so if I run my phpinfo.php or my “php -i” from somewhere else except ~/piwik, I get the above mentioned 70M memory limit. So I added a copy of the php.ini with the 512M limit into each and every sub directory - still nothing, still stuck at 97.5M.
What else can I do? I’m open to any kind of suggestion.