Issue
I am trying to run a cron-job that automates the cache rebuild function of Woo Search Box plugin.
The plugin has this dynamic cron command, that I set to run once a day at 1AM:
php /home/carit/public_html/index.php 16021417635f7ebe43c604a
I am well experienced with cron jobs inside of C-Panel but I can't figure out what prevents this cron from running. All in all, I have tried what the documentation suggests here, also tried usr/bin/php
instead of php
but it didn't make any difference.
If I run this cron-job inside my server's terminal, it works like a charm and the cache is being rebuilt. It only seems to not be working when I run it via cron-job.
Does anyone have any suggestions or ideas on why doesn't this cron-job works?
Please correct me in the comments in case I forgot to provide any key information about my problem, Thanks.
Solution
It seems that some newer versions of CentOs or Ubuntu servers use either /usr/local/bin/php
or simply /usr/bin/php
. If you have ftp access to the server you want the cron to run in, make sure to check for the php file in both paths recommended above before trying to use the ordinary php
before a cron job.
Answered By - Jameu Lukasli1