I’m current having an issue with my instance of Kanboard. I’m using a shared-hosting, and Kanboard was installed using the Softaculous installation mode.
One issue that I noticed is that the Softaculous script creates a cronjob like mentioned in the documentation, but this is not working. I’ve tried to change the code of it (by adding php before cli otherwise I do get an error), but it still doesn’t work.
The weirdest part, is that if I open the cPanel’s terminal and I do paste the code of the cronjob, the automations set on the projects do work as expected.
The current code is: (I’ve replaced the user and domain here, for privacy reasons)
cd /home/<my_user>/<my.domain.com> && php cli cronjob >/dev/null 2>&1
I’ve reached out to the hosting support, and they told me that from their side the cronjob is working as expected.
Does anyone have any idea what might be the issue here?
Best regards!
Edit: This comment helped me to solve the issue. In my case, using /usr/local/bin/php /home/<my_user>/<my.domain>/cli cronjob >/dev/null 2>&1 worked.
First off, this contains an error. The correct redirection is 2>&1 > /dev/null.
Hint: Never add the redirection until you’re sure the command really works.
The Softaculous installer, creates a cron job automatically for Kanboard. If, for some reason, it doesn’t work properly for you, follow these steps:
In cPanel go to the Cron Jobs option.
The Current Cron Jobs section might have more than one job (depending on your usage). The Kanboard one should be the one which has the command like this: cd /home/<YOUR_USER>/<YOUR_DOMAIN.com> && php cli cronjob >/dev/null 2>&1(YOUR_USER and YOUR_DOMAIN are just placeholders. You should have a different value).
Edit that one and just change that command into /usr/local/bin/php /home/<YOUR_USER>/<YOUR_DOMAIN.com>/cli cronjob >/dev/null 2>&1
For custom PHP versions on cPanel
If you are using specific PHP versions for Kanboard (cPanel allows you to do this), you might have to change the command on step 3 to match this. In my case, I’m using PHP 8.3 specifically for Kanboard, so my cronjob command is: /usr/local/bin/ea-php83 /home/<YOUR_USER>/<YOUR_DOMAIN.com>/cli cronjob >/dev/null 2>&1 (it comes after the /bin/ part).
If you have doubts, check the MultiPHP Manager option on cPanel, and it will show you if you are using a custom one, and which one. E.g.: PHP 8.1 (ea-php81), PHP 8.3 (ea-php83)… what you want is the version between parenthesis.