CRON Doesn't work

I have installed this on a shared hosting account. I have the below line in my CRON. But it doesn’t work and it actually shows a warning at the bottom left corner saying “The crons need to be enabled”

cd /home/deepegdn/billing.amazingworkz.com && php -d register_argc_argv=On artisan schedule:run > /dev/null 2>&1

Please help me in fixing this.

Hi,

@david any thoughts on how to debug this?

@deepakdhamuria

Perhaps you also need the path to the PHP binary ?

The command as such works fine when I run through terminal. So the PHP doesn’t need full path. Also another similar CRON job works just fine.

When I run it in console, it says

No scheduled commands are ready to run.

I am seeing the same problem.
The cron jobs are scheduled and seem to be running fine (cpanel multi-hosted environment running v5.1.61 on PHP 8.0.), but am seeing the red triangle in Invoice Ninja saying the crons need to be enabled.

Well, I ended up deleting my v5 instance. I am back to using v4. Another problem I was facing during migration was that none of my payments got migrated, so all my invoices were showing as paid with same amount due :sweat_smile:. Anyway will wait till it’s out of beta I guess.

@deepakdhamuria @SalesNinja

Most cron jobs fail because the owner of the job is wrong. IN cronjobs need to be owned by the owner of the webserver service, ie the same owner as the folder that IN is installed into.

So check who owns the cronjob :wink:

HTH

It might be down to the folder you are in when you run the command manually and the one the system is trying to run it from…
Try testing a single command manually and as the cron:

php -d register_argc_argv=On /home/deepegdn/billing.amazingworkz.com artisan schedule:run > /dev/null 2>&1

1 Like