@anonymous-piwik-user opened this Issue on January 7th 2014

When using cPanel to set up the cron job as per http://piwik.org/docs/setup-auto-archiving/ , you may encounter an issue where cPanel will refuse to create (or edit) the cron job for Piwik.

A typical command might be, for example:

/opt/php54/bin/php path_to_piwik/misc/cron/archive.php --url=http://example.com >/dev/null 2>&1

However, doing so in my case will not work, cPanel will give me an error in a red rectangle box: "JSON parse failed."

Weirdly enough, Hostgator administrators (ie: root) are able to do it with cpanel (so they can't reproduce the issue on their end), but a "normal" user like me cannot. This is regardless of which web browser is used.

We narrowed down the issue to be due to the presence of "http://". For example, I can create this fake cron job:

echo desu example.com >/dev/null 2>&1

...but not this one:

echo desu http://example.com >/dev/null 2>&1

Hoping there's something that could be improved on the piwik side, like making the http/https part optional/autodetectable (and documenting that)...

@mattab commented on January 7th 2014 Member

In 267b71741ee74b2cca99ab5d15f1c48d273f0014: Fixes #4483 - thanks for the report that's really useful as loads of users are on cpanel and hostgator!
Also updated the doc at: http://piwik.org/docs/setup-auto-archiving/#cpanel-how-to-set-up-the-cron-script-using-cpanel
and removed http:// in the cpanel examples..

This Issue was closed on January 7th 2014
Powered by GitHub Issue Mirror