Solved - CRON Archive error - PHP Fatal error: Class 'Piwik\CliMulti\CliPhp' not found in /srv/piwik/core/CliMulti.php on line 187

Hi.

This is my first attempt at setting up archiving via cron. I’m running Piwik 2.9.1 - and have the cron setup having followed the guide in the docs:


/usr/bin/php /srv/piwik/console core:archive --url=http://URL/ > /home/piwik/piwik-archive.log

But I get the following error when it runs:


PHP Fatal error:  Class 'Piwik\CliMulti\CliPhp' not found in /srv/piwik/core/CliMulti.php on line 187

PHP is version 5.3.3 so supports namespaces. Permissions are all correct within the piwik directory. All the files are there that it expects, so I’m not sure where to look next to debug the issue… any pointers would be appreciated.

Cheers

In Piwik > Settings > Diagnostic > System check do you see any error there? maybe some of the files were not uploaded?

Hi Matt.

If I click on this page, I get the same error but within the page now:


A fatal error occurred

The following error just broke Piwik (v2.9.1):

Class 'Piwik\CliMulti\CliPhp' not found
in
/srv/piwik/core/CliMulti.php line 187

It suggests the following :


Troubleshooting

Follow these steps to solve the issue or report it to the team:
If you have just updated Piwik to the latest version, please try to restart your web server. This will clear the PHP opcache which may solve the problem.
If this is the first time you see this error, please try refresh the page.
If this error continues to happen, we appreciate if you send the error report to the Piwik team.

I’ve restarted apache, which in turn would flush the APC opcode cache

I’ve backed up config.ini.php, removed the piwik folder, extracted piwik.zip again and copied config.ini.php back over.

Everything now works, including the cron job.

My guess is the original zip file extraction couldn’t have worked properly, so the file containing the class really wasn’t there, hence the error.