Console error when using cron to auto-archive

Using Piwik 2.4.0-b5 and running a cron job in cPanel to auto archive as per the instructions in the Piwik docs section.

This is the job…


/usr/local/bin/php -f /home/user/public_html/analytics/console core:archive --url=http://www.analytics.domain.com/ > /home/user/public_html/analytics/piwik-archive-output.log

I get this in the piwik-archive-output.log


Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in /home/user/public_html/analytics/console on line 23

Parse error: syntax error, unexpected T_STRING in /home/user/public_html/analytics/console on line 23

Line 23 of that file is


Piwik\Translate::loadEnglishTranslation();

it looks like your PHP CLI Is not running at least PHP 5.3

PLease check that your PHP CLI is using at least PHP 5.3.1 - ask your webhost if you have a question

I’m having the exact same problem, and I am running Piwik 2.4.0 on PHP 5.4, though the PHP CLI is version 5.2.17.

Does this mean that the archiving is not working?

Since I’m on shared hosting, I don’t think I can use a different version of the PHP CLI. Any suggestions?

Ask your web host how you can use newer version of PHP on the CLI, they should offer this option

Thanks Matt, yes they do, and now it’s working perfectly.