When running the cron job on DreamHost to execute the archive.sh I’m getting the following error message:
php binary not found. Make sure php5 or php exists in PATH.
What I have understood so far is, that I have to modify the archive.sh to point to the PHP interpreter (in my case PHP is located in /usr/local/bin/php). Where do I modify the script? Or better could somebody please post a modified archive.sh
I’ve never used the SSH access to set-up my cron (and I’m not very familiar with it either). In DreamHost you can set up the cron jobs in the Panel. Thats the reason I thought my only way out would be to modify the archive.sh. If this file gets updated with every new release it’s out of the question to modify it.
To allow me a good start with creating the cron job with SSH could you please give me the “whole thing” (meaning the cron job) considering:
The location of the Piwik install: /home/myuser/mysite/statistics/misc/cron/archive.sh
The PHP being located in: /usr/local/bin/php
We are hosted by 1and1 and have a problem getting the script to run i have tried modifying the script as above adding the path to the cron etc. nothing seems to work, in the end i gave up i just don’t have enough knowledge to implement archiving. still loving piwik tho …ty.
(1and1 use php4 by default, we use the .htaccess trick for php5)
php5 is located at: /usr/bin/php5
we get the following output from the script
: invalid option
We have spoken to our host about it and their reply is below.
Also, i did notice a forum post where a php script had been used as the archiving script but it had stopped working since 1.4. It would be nice if there was an alternative php script for archiving. There must be a lot of users on shared hosts that can not get this to work. http://forum.piwik.org/read.php?2,77295
You’re right, thanks Anthon! I thought the script was running fine because I wasn’t getting an error in the Cron emails, but it turns out the script wasn’t being processed. I spent some time with Dreamhost’s Customer Service and was able to get it running by doing the following steps:
Log in to the account using SSH
Enter this into the command line: “echo $PATH”
This spit out a bunch of path variables. Copy this data.
Go to the Cron Job and enter the PATH data before the cron. It should look something like this:
Note that this command was entered using the Cron Job manager in their Control Panel, not the SSH command line.
When the script ran, I was also getting the following error:
suhosin: ALERT - script tried to increase memory_limit to 134217728 bytes which is above the allowed value (attacker '220.127.116.11', file '/home/USERNAME/PIWIKFOLDER/core/Piwik.php', line 881)
I changed the minimum_memory_limit in config.ini to be 85MB and the script ran without errors. I’m on a VPS, so the memory limit might be lower for standard hosting packages. Now my Piwik dashboard is running very fast!
I hope this helps save someone else the time it took to troubleshoot.
Edit: Updated the cron command for accuracy and included better instructions