Php artisan:run cron job not working (php8.1)

Hi, I have added the cron job for artisan:run in my hestiacp cron tab and it is not working. Following codes I have tried so far,

  1. /usr/bin/php8.1 /home/admin/web/domain.com/public_html/domain/artisan schedule:run

  2. /usr/bin/php /home/admin/web/domain.com/public_html/domain/artisan schedule:run

  3. php /home/admin/web/domain.com/public_html/domain/artisan schedule:run

  4. php -q /home/admin/web/domain.com/public_html/domain/artisan schedule:run

Please guide me to fix this issue.

I use my self:

cd /home/client/web/client.com/public_html/folder/ && /usr/bin/php8.3 artisan schedule:run

1 Like

Let me try the same.

No, It is not working @eris

What happens if you login via ssh and run:
cd /home/client/web/client.com/public_html/folder/ && /usr/bin/php8.3 artisan schedule:run

Please make you use the correct php version

output:
[2024-11-13T17:49:53+05:30] Running scheduled command: ‘/usr/bin/php8.1’ ‘artisan’ get:access_token_user > ‘/dev/null’ 2>&1
[2024-11-13T17:49:53+05:30] Running scheduled command: ‘/usr/bin/php8.1’ ‘artisan’ get:access_token_driver > ‘/dev/null’ 2>&1

I have set php8.1 as the system version as well as for the domain.

Hi, Any workaround?

You didn’t run in in CLI via ssh …

Also remove /dev/null 2>&1 it deletes any debugging shit


Refer to the screenshot above.

So it works…

But the result is not showing in DB? why?