Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Vishaal's avatar

Laravel artisan cron task not working on ubuntu 18.10

Hello I have enabling the cron feature for Laravel on Ubuntu 18.10 on Vultr VPS server.

I have added the cron task to the cron jobs list using the command

    crontab -e

Then I have added the command listed in the laravel documentation

    * * * * *       cd /var/www/html/hva && php artisan schedule:run >> /dev/null 2>&1

I have made sure that cron is running and I can see that the task is running if I run

    sudo grep -i cron /var/log/syslog|tail -3

Which returns

    May 20 20:56:01 HiRe-Pro-Web CRON[1819]: (root) CMD (cd /var/www/html/hva && php artisan schedule:run >> /dev/null 2>&1)
    May 20 20:57:01 HiRe-Pro-Web CRON[1862]: (root) CMD (cd /var/www/html/hva && php artisan schedule:run >> /dev/null 2>&1)
    May 20 20:58:01 HiRe-Pro-Web CRON[1898]: (root) CMD (cd /var/www/html/hva && php artisan schedule:run >> /dev/null 2>&1)

manual runs fine

php artisan schedule:run

Does anyone have any suggestions where I'm going wrong here.

0 likes
4 replies
Snapey's avatar
Snapey
Best Answer
Level 122

how do you know its not doing anything?

Vishaal's avatar

@SNAPEY - because the status must create invoices. But this not happens automatically but when i run manual it does it.

Snapey's avatar

personally I prefer to specify the full path to the php executable since the user account you are running the cron as may not have php in the path

Vishaal's avatar

@SNAPEY - I have setup the cron in root account. I have changed the cron now to

* * * * *       php /var/www/html/hva/artisan schedule:run >> /dev/null 2>&1

but it still not working.

Please or to participate in this conversation.