0
votes

I’m setting up a Cron Job for my laravel Schedule in CpaneL but it's not working. Please, i need help on how to do schedule:run in cPanel Cron Job.

This is what i have tried in cPanel Cron Job

/usr/local/bin/php7 /home/cattonli/public_html/artisan schedule:run >> /dev/null 2>&1

php artisan schedule:run works fine offline, but i can't get it to work offline.

1
This looks like a very cpanel-specific question, try including some tags to attract the right stackoverflow readers. I would also check if /home/cattonli/public_html/artisan is executable. Finally, you could remove the ">> /dev/null 2>&1" portion and see if you get any cron errors that could help you troubleshoot where the problem is. - Ben Sholdice
Okay, thanks. I'll try this now. But how do i check if /home/cattonli/public_html/artisan is executable? Sorry, am new to this. - chokovel
try ls -l /home/cattonli/public_html/artisan and check the file permissions. check linuxcommand.org/lc3_lts0090.php to learn more about permissions. - Ben Sholdice

1 Answers

0
votes

I Hope "cattonli" is the username. Try Below if it works for you.

If you have created "laravelapp" folder inside project folder try

/usr/local/bin/php7/bin/php-cli/home/cattonli/public_html/{project_folder_name_if_any_or_skip}/laravelapp/artisan schedule:run >> /dev/null 2>&1