Search code examples
cronlaravel-5

cron job not running in goDaddy shared host for laravel 5.2


I am trying to run cron job in my laravel 5.2 application hosted in goDaddy shared host.

I have cPanel access and there I added a cron job, something like this:

* * * * * php /home/path/to/artisan schedule:run 1>> /dev/null 2>&1

But the issue is that the server is not calling schedule action in Kernel.php. The same works fine in my local system.

Can anyone point out the mistake please or suggest some way to accomplish this so that server runs the cron job so as to execute defined commands.


Solution

  • Add path of php binary to cron command.

    * * * * * path/php /home/path/to/artisan schedule:run 1>> /dev/null 2>&1
    

    Example : /usr/bin/php