I am trying to execute the archive.php script prior to establishing as a scheduled task. Each time I run it I get this set or error messages:
SUMMARY OF ERRORS
Error: Got invalid response from API request: http://services.nconemap.com/piwi
/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=month&date
last15&format=php&token_auth=XXXXXXXXXX&trigger=archiveph
. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. Please....
This occurs when attempting the report generation for month and year. The recommended fix is to increase the memory limit of php. I currently have it set to 3G. I can’t believe that it would need even more than that but am I wrong? Any other suggestions on how to get this to cleanly execute? I would like to be able to successfully run this a few times manually before setting it up for automation. Thanks.
[30-Oct-2013 22:04:06 UTC] PHP Fatal error: Out of memory (allocated 1748238336) (tried to allocate 4104 bytes) in D:\piwik\core\DataTable.php on line 1050
I am running PHP 5.5 with opcache (if it makes a difference).
I should mention that I am trying to compile reports for the first time. I have imported data from January 1 of this year. The archive routine runs fine for day, week, but chokes when it gets to “month.” As I mentioned, I have the memory set at 3gig. If I raise that limit to 4gig and try to run archive.php I receive an immediate response of “the piwik url does not seem to be pointing to a piwik server.”
Thanks Matt. One question, I’ve seen some posts where there are memory settings within the config file of piwik (memory limit and memory limit when archiving). Should these be adjusted and how should they mimic (if at all) what is set in php.ini? You know already by my previous posts that I am not a php guy. However, I would really like to use this product and I just need to know the memory settings for Piwik and PHP that is optimal.
I will wait for your response and attempt again. If that fails, then I will upgrade.
From the php error log, I have noticed that it always logs the at about the same size allocated (~1.5Gb) even though the setting is set much higher (8Gb).
Error log output snippet from three attempts to run archive.php:
Out of memory (allocated 1582301184) (tried to allocate 36 bytes)
Out of memory (allocated 1599340544) (tried to allocate 36 bytes)
Out of memory (allocated 1599864832) (tried to allocate 4104 bytes)
Is there any other place (e.g., MySQL, OS, etc.) where a setting could be causing this issue? I’m running out of ideas.
Configuration:
Windows Server 2008 R2
Intel Xeon 2.27GHz (2 processors)
16G RAM
PHP v5.5
Piwik v2 beta
I ran into memory limit when processing the months as well, and I don’t have access to modify php.ini. My work around is to call archive.sh instead and set the memory limit there:
for TEST_PHP_BIN in php5 php php-cli php-cgi; do
if which $TEST_PHP_BIN >/dev/null 2>/dev/null; then
PHP_BIN=`which $TEST_PHP_BIN`
break
fi
done
if test -z $PHP_BIN; then
echo "php binary not found. Make sure php5 or php exists in PATH." >&2
exit 1
fi
PHP_BIN="$PHP_BIN -d memory_limit=4096M"