I was trying to run the archive scripts. First I tried the archive.sh script, but noticed that whilst it didn’t complain about anything, it didn’t really seem to do anything either… Inspecting it a little closer, I noticed it wasn’t able to pick up values correctly, for example:
CMD_TOKEN_AUTH="$PHP_BIN -q $PIWIK_PATH -- module=API&method=UsersManager.getTokenAuth&userLogin=$PIWIK_SUPERUSER&md5Password=$PIWIK_SUPERUSER_MD5_PASSWORD&format=php&serialize=0" TOKEN_AUTH=`$CMD_TOKEN_AUTH` echo $TOKEN_AUTH # this outputs nothing, even though all parameters (e.g. md5 are correct)
#TOKEN_AUTH was empty…
I then tried to run the archive php on my browser using:
But then I noticed that the script complains with several errors like this:
ERROR: Got invalid response from API request: https://piwik.my-site.com/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=day&date=last52&format=php&token_auth=xxxxx&trigger=archivephp. Response was ‘curl_exec: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed’
I am using a self-signed certificate for piwik, and have set my browser to always trust it. This way, I still get SSL protection without having to pay for the certificate. My browser is quite happy with this, and I can also instruct CURL to ignore any certificates with the
-k switch, but the archive.php script seems to fail…
Any suggestions on how to resolve this (without having to buy an official certifcate)? Is there a way to tell piwik to trust my certificate, or ignore certificate errors? Or some different way to run the php script from the command line?
Thanks in advance!