• <i id='REsGw'><tr id='REsGw'><dt id='REsGw'><q id='REsGw'><span id='REsGw'><b id='REsGw'><form id='REsGw'><ins id='REsGw'></ins><ul id='REsGw'></ul><sub id='REsGw'></sub></form><legend id='REsGw'></legend><bdo id='REsGw'><pre id='REsGw'><center id='REsGw'></center></pre></bdo></b><th id='REsGw'></th></span></q></dt></tr></i><div id='REsGw'><tfoot id='REsGw'></tfoot><dl id='REsGw'><fieldset id='REsGw'></fieldset></dl></div>
    <legend id='REsGw'><style id='REsGw'><dir id='REsGw'><q id='REsGw'></q></dir></style></legend>
      <bdo id='REsGw'></bdo><ul id='REsGw'></ul>

  • <small id='REsGw'></small><noframes id='REsGw'>

      1. <tfoot id='REsGw'></tfoot>

        Laravel“没有准备好运行的预定命令."

        时间:2023-08-17
        • <bdo id='CJD1D'></bdo><ul id='CJD1D'></ul>
          1. <i id='CJD1D'><tr id='CJD1D'><dt id='CJD1D'><q id='CJD1D'><span id='CJD1D'><b id='CJD1D'><form id='CJD1D'><ins id='CJD1D'></ins><ul id='CJD1D'></ul><sub id='CJD1D'></sub></form><legend id='CJD1D'></legend><bdo id='CJD1D'><pre id='CJD1D'><center id='CJD1D'></center></pre></bdo></b><th id='CJD1D'></th></span></q></dt></tr></i><div id='CJD1D'><tfoot id='CJD1D'></tfoot><dl id='CJD1D'><fieldset id='CJD1D'></fieldset></dl></div>

                <tbody id='CJD1D'></tbody>
                <legend id='CJD1D'><style id='CJD1D'><dir id='CJD1D'><q id='CJD1D'></q></dir></style></legend>

              • <small id='CJD1D'></small><noframes id='CJD1D'>

                1. <tfoot id='CJD1D'></tfoot>
                  本文介绍了Laravel“没有准备好运行的预定命令."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经设置了以下 Laravel 命令:

                  I've set up the following Laravel commands:

                  protected function schedule(Schedule $schedule) {
                          $schedule->command('command:daily-reset')->daily();
                          $schedule->command('command:monthly-reset')->monthly();
                  }
                  

                  然后,在我的服务器上,我设置了一个每天运行一次的 cron 作业(在 00:00).

                  Then, on my server, I've set up a cron job to run once per day (at 00:00).

                  0 0 * * * php /home/privates/public_html/staging/current/artisan schedule:run
                  

                  我的 cron 作业每晚都成功运行,但日志只是说:没有准备好运行的预定命令."

                  My cron job is running successfully each night, but the logs simply say: "No scheduled commands are ready to run."

                  我做错了什么?我希望我的 daily 命令每晚运行一次.

                  What am I doing wrong? I would expect my daily command to run each night.

                  谢谢!

                  推荐答案

                  您是否尝试过手动运行命令?

                  Did you try running command manually?

                  运行 php artisan 并查看您的命令是否已注册.

                  Run php artisan and see if your commands have registered.

                  如果你已经注册了你的命令,你应该在可用的 artisan 命令列表下看到 command:daily-resetcommand:monthly-reset.

                  If you have registered your commands you should see command:daily-reset and command:monthly-reset under the list of available artisan commands.

                  如果您没有看到它们,请继续并通过将其添加到 app/Console/Kernel.php 中的 commands 属性来注册您的命令.

                  If you don't see them there go ahead and register your commands by adding it to commands property available in app/Console/Kernel.php.

                  protected $commands = [
                      'AppConsoleCommandsYourFirstCommand',
                      'AppConsoleCommandsYourSecondCommand'
                  ];
                  

                  将 crontab 条目更改为

                  Change crontab entry to

                  * * * * * php/home/privates/public_html/staging/current/artisan schedule:run

                  这篇关于Laravel“没有准备好运行的预定命令."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Laravel 中的 Cron 作业 下一篇:仅在特定时间每分钟运行一次 cron 作业?

                  相关文章

                2. <tfoot id='WoP6G'></tfoot>

                  • <bdo id='WoP6G'></bdo><ul id='WoP6G'></ul>
                  1. <i id='WoP6G'><tr id='WoP6G'><dt id='WoP6G'><q id='WoP6G'><span id='WoP6G'><b id='WoP6G'><form id='WoP6G'><ins id='WoP6G'></ins><ul id='WoP6G'></ul><sub id='WoP6G'></sub></form><legend id='WoP6G'></legend><bdo id='WoP6G'><pre id='WoP6G'><center id='WoP6G'></center></pre></bdo></b><th id='WoP6G'></th></span></q></dt></tr></i><div id='WoP6G'><tfoot id='WoP6G'></tfoot><dl id='WoP6G'><fieldset id='WoP6G'></fieldset></dl></div>

                    <small id='WoP6G'></small><noframes id='WoP6G'>

                      <legend id='WoP6G'><style id='WoP6G'><dir id='WoP6G'><q id='WoP6G'></q></dir></style></legend>