PIWIK archive cron on 1&1 webserver (no CLI)

Hello,

I tried to switch the archive cron from archive.php to the new recommended way in How to Set up Auto-Archiving of Your Reports - Analytics Platform - Matomo (Linux/Unix)

calling it with /usr/local/bin/php5.4 brings the error message:

Piwik Console is known to be not compatible with PHP-CGI. Please execute console using PHP-CLI. For instance “/usr/bin/php-cli console …”

But unfortunately on my webserver hosted by 1&1 there ist no php-cli (or phpx.x-cli).

Is there a solution for this?

Greetings
woltis

woltis, I don’t know the answer to your question, but I’m curious…are you switching to the archive after upgrading to 2.4.0 and observing your reports breaking?

Yes, Mike, you’re right.
The cron with archive.php had no problem. But after updating to 2.4 it reported an error:

Error in argument 1, char 2: option not found r

Looking into the script I found the message, that archive.php is no longer recommended. So I tried to switch.

Greetings
woltis

please ask to 1&1 support what is the PHP to PHP CLI and then specify this path in the cron task

Actually it was working till monday, then 1&1 changed something.

Is there any solution yet? Is there a “–commandline” flag for php or something?

Thank you

I already asked the 1&1-support, but they still have not been able to answer the question. Asked a second time, so let’s see …

It’s sometimes hard to get an easy answer from the support if you ask an easy question :frowning:

Here is the official answer from 1&1 support:

PHP CLI is not possible on a 1&1 managed server

So what to do now? How do I setup my archvive cron, if console with php cli does not work and archive.php (which worked well untill 2.4 reports errors)?

Anybody?

How do I set up my cron without PHP-CLI. It worked with archive.php till PIWIK 2.3 without problems.

How to fix this with 2.4?

PHP CLI is not possible on a 1&1 managed server

I’m pretty sure this is wrong. 1&1 used to provide a PHP CLI and definitely they should provide this as this is part of “PHP”

1&1 has different servers.

They have managed servers, where 1&1 is responsible for the operating system and other server-side software.

And they have root-servers, where the customer is responsible for everything.

Only for the last ones you will get root access as a customer. On managed servers without root access PHP-CLI is not possible, says 1&1.

So how do I setup my cronjob without CLI? archive.php still works, but it throws out


Error in argument 1, char 2: option not found r 

since version 2.4 of PIWIK.

@wolts please setup the new cron as in: How to Set up Auto-Archiving of Your Reports - Analytics Platform - Matomo

Does it work for you? If you have a problem please let us know (or maybe ask 1&1 support if they have an idea)

(if we can improve the documentation for users on 1&1 we would love to know how :))

Hello Matt,

as far as I can see, nothing has changed in the cron settings. It still requires php-cli which is not available on my managed 1&1-server.

I still use the old way to process the data:


php5.4 /path/to/htdocs/piwik/misc/cron/archive.php --url=https://www.mywebserver.de/piwik

This still works great, exept that it throws out an error with every processed website/id


Error in argument 1, char 2: option not found r

I disabled the email in the cron, so I don’t receive an email-every hour the cron is running.

Isn’t it possible to still use the old cron-call but change something, that eliminates this error message?

did you try this:


php5.4 /path/to/htdocs/piwik/console core:archive --url=XXX

Hello Matt,

this does not work (which was the reason for this thread). you need PHP-CLI to run console, which is not installed. I get the message:


Piwik Console is known to be not compatible with PHP-CGI. Please execute console using PHP-CLI. For instance "/usr/bin/php-cli console ..

So again: how to run cron without PHP-CLI?

Instead maybe you could ask your webhost if they provide PHP CLI and what is the path for it? so far I didn’t hear any web host that does not offer it so I think yours is likely to offer it?

Hi matt,

thanks for your interest in this problem!
Regarding your last post, woltis asked already and the answer is no, see post 7 in this thread. I also think such a big company as 1&1 can’t enable it so easily, so probably they won’t. Hence his question “how to run cron without PHP-CLI?”.

Hello Matt,

we are turning around in circles in this thread :wink:

1&1 does DEFINITLY not offer PHP-CLI on managed servers (which is mine), only on root servers. So I only need a non-CLI way to process the archive-cron without error-messages .

Sorry guys! I should have re-read this post before asking this again…

Could you try apply this patch: Better debug output for forum debugging http://forum.piwik.org/read.p… · matomo-org/matomo@83e9d6a · GitHub

and then run the core:archive again and paste here the new error message?

Did as requested. The message is:


Piwik Console is known to be not compatible with PHP-CGI (you are using cgi-fcgi). Please execute console using PHP-CLI. For instance "/usr/bin/php-cli console ..."

HELP!

With the update to version 2.5 the use of archive.php is no longer possible at all!

So I can’t process the automatic achiving at all right now!

I URGENTLY need a solution for this.