plu plu
plu plu

Reputation: 149

laravel 5.5 schedule:run cron job not working in cpanel

I'm have a laravel5.5 project up on shared hosting and trying to run cron job to execute the command "schedule:run" but it just won't execute I think I'm writing the command wrong:

/usr/local/bin/php home/schoolco/prototype/artisan schedule:run >> /dev/null 2>&1

where prototype in the name of my laravel project. the command works in this directory using ssh. please if you have any observation or thought share it.

Upvotes: 1

Views: 3574

Answers (3)

Muhammad Wasim Akram
Muhammad Wasim Akram

Reputation: 1079

If your Project is in Root Directory

cd /home/cpanel/public_html && /usr/local/bin/ea-php72 artisan schedule:run >> /dev/null 2>&1

If your Project in a folder within Public_Html then use below

 cd /home/cpanel/public_html/folder_name && /usr/local/bin/ea-php72 artisan schedule:run >> /dev/null 2>&1

Hope it will work for you. Thanks

Upvotes: 2

Excellent Lawrence
Excellent Lawrence

Reputation: 1104

I solved the issue by specifying the php version in the command line:

* * * * * /usr/local/bin/ea-php71 /home/nemanu/root1/artisan schedule:run >> /dev/null 2>&1

Upvotes: 1

ReesBo
ReesBo

Reputation: 94

Try like this

/usr/local/bin/php /home/schoolco/prototype/artisan schedule:run > /dev/null 2>&1

And check are you calling right php executable in your terminal with:

$ which php

Maybe it is not /usr/local/bin/php , maybe /usr/bin/php

Upvotes: 4

Related Questions