I receive the errors trying to archive.
WARNING [2020-05-29 10:06:18] 8956 D:\Bitnami\wampstack\apps\piwik\core\Common.php(297): Notice - unserialize(): Error at offset 0 of 342 bytes - Matomo 3.13.5 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it mi
ght have been reported already)
module=API&method=API.get&idSite=33&period=day&date=last3&format=php&trigger=archivephp&token_auth=removed. Response was ‘curl_exec: SSL cert
ificate problem: self signed certificate in certificate chain. Hostname requested was: server.com’’ for website id 33, Time elapsed: 0.277s, skipping
If your Matomo server uses a self-signed certificate (so not signed by a major CA) then it is not enough to make your Browser trust this certificate/CA. You also need to make sure the webserver itself trusts the certificate. Matomo accesses the HTTP API itself (e.g. during archiving), so you want to make sure that a curl https://your.matomo on your server also reports a valid certificate and maybe add your CA to the root CA store.
These are entrust certificates. I use them on Redhat Linux with Matomo and I’m currently moving the Matomo server to Windows 2019 using bitnami wamp server. I never noticed the issue on the redhat server.
I have ran it with php.exe “D:\Bitnami\wampstack\apps\piwik\console” core:archive --url=https://etpanalytics.jnj.com/console --accept-invalid-ssl-certificate
Now I have another error:
INFO [2020-06-02 19:54:40] 6988 Error: Got invalid response from API request: ?module=API&method=API.get&idSite=6&period=day&date=last7&format=php&trigger=archivephp. Response was ‘<?php use Piwik\FrontController; if (!defined(‘PIWIK_DOCUMENT_ROOT’)) { define(‘PIW
IK_DOCUMENT_ROOT’, dirname(FILE) == ‘/’ ? ‘’ : dirname(FILE)); } if (file_exists(PIWIK_DOCUMENT_ROOT . ‘/bootstrap.php’)) { require_once PIWIK_DOCUMENT_ROOT . ‘/bootstrap.php’; } if (!defined(‘PIWIK_INCLUDE_PATH’)) { define(‘PIWIK_INCLUDE_PATH’, PIWIK_D
OCUMENT_ROOT); } require_once PIWIK_INCLUDE_PATH . ‘/core/bootstrap.php’; if (!Piwik\Common::isPhpCliMode()) { exit; } if (!defined(‘PIWIK_ENABLE_ERROR_HANDLER’) || PIWIK_ENABLE_ERROR_HANDLER) { Piwik\ErrorHandler::registerErrorHandler(); Piwik\ExceptionHa
ndler::setUp(); } FrontController::setUpSafeMode(); $console = new Piwik\Console(); $console->run();’
INFO [2020-06-02 19:54:40] 6988 Error: Empty or invalid response ‘’ for website id 6, Time elapsed: 0.380s, skipping
INFO [2020-06-02 19:54:40] 6988 Error: Got invalid response from API request: ?module=API&method=API.get&idSite=7&period=day&date=last7&format=php&trigger=archivephp. Response was ‘<?php use Piwik\FrontController; if (!defined(‘PIWIK_DOCUMENT_ROOT’)) { define(‘PIW
IK_DOCUMENT_ROOT’, dirname(FILE) == ‘/’ ? ‘’ : dirname(FILE)); } if (file_exists(PIWIK_DOCUMENT_ROOT . ‘/bootstrap.php’)) { require_once PIWIK_DOCUMENT_ROOT . ‘/bootstrap.php’; } if (!defined(‘PIWIK_INCLUDE_PATH’)) { define(‘PIWIK_INCLUDE_PATH’, PIWIK_D
OCUMENT_ROOT); } require_once PIWIK_INCLUDE_PATH . ‘/core/bootstrap.php’; if (!Piwik\Common::isPhpCliMode()) { exit; } if (!defined(‘PIWIK_ENABLE_ERROR_HANDLER’) || PIWIK_ENABLE_ERROR_HANDLER) { Piwik\ErrorHandler::registerErrorHandler(); Piwik\ExceptionHa
ndler::setUp(); } FrontController::setUpSafeMode(); $console = new Piwik\Console(); $console->run();’
INFO [2020-06-02 19:54:40] 6988 Error: Empty or invalid response ‘’ for website id 7, Time elapsed: 0.307s, skipping
Your webserver should never respond with PHP code as it should be executed instead. Make sure that your webserver is correctly set up to run PHP on requests.
Also this might mean that visitors opening /config/config.ini.php might be able to see its content. In that case you might want to reset the Matomo salt and your MySQL password.