Presence of "http://" in the parameters of the archive cron script may cause incompatibility with cPanel #4483

Closed
anonymous-piwik-user opened this Issue Jan 7, 2014 · 1 comment

2 participants

@anonymous-piwik-user

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
Piwik Open Source Analytics member

In 267b717: 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..

@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@mattab mattab 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..
267b717
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment