Sharing an issue I encountered after adding my Laravel task scheduling cronjob to freebsd and my tasks where not being executed. A quick way to test your cronjob is to use the following information:
Cronjob:
# /etc/crontab - root's crontab for FreeBSD # # $FreeBSD$ # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin # Order of crontab fields # minute hour mday month wday command * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
Test Command:
env -i SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin HOME=/home/freebsd LOGNAME=freebsd php /path/to/artsan/artisan schedule:run
The key to solving the issue is to add the path where you installed the PHP binary on the server. In my case its
/usr/local/bin
Advertisements