Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
668 views
in Technique[技术] by (71.8m points)

php - Laravel schedule:run is not working when added into the cron job

I have made a command and scheduled it for every 30 minutes. When I run php artisan schedule:run it works perfectly fine and returns with the expected results, but when I configured it on my live server my cron job do run but instead of retuning the success message it returns with list of all available command in my laravel project. Here is what I am doing.

Command Kernel:

$schedule->command('update:callLogs')
            ->everyMinute();

Cron Entry:

/usr/bin/php /home/ddsas9rm2f1g/public_html/clowdlink.com/crm/artisan schedule:run

And this is the response I am getting

Laravel Framework 5.8.38

Usage:
command [options] [arguments]

Options:
 -h, --help            Display this help message
 -q, --quiet           Do not output any message
 -V, --version         Display this application version
  --ansi            Force ANSI output
  --no-ansi         Disable ANSI output
 -n, --no-interaction  Do not ask any interactive question
  --env[=ENV]       The environment the command should run under
 -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
 (List of all availabe commands)

Any help will be much appreciated.

EDIT Now my command looks like this

* * * * * cd /home/ddsas9rm2f1g/public_html/clowdlink.com/crm && php artisan update:callLogs

but getting the same response whereas when I copy the same command and using putty ran the same command and it works perfectly fine. Now it's been a week now and I'm still stuck at this cron thing.

question from:https://stackoverflow.com/questions/65931665/laravel-schedulerun-is-not-working-when-added-into-the-cron-job

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I faced big challenge as well when I was deploying one my applications, and finally managed to tackle it with:

cd /path-to-project && /opt/cpanel/ea-php71/root/opt/cpanel/ea-php74/root/usr/bin/php-cgi artisan schedule:run

I use Laravel 5.7 for my application


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...