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

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

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

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

        自定义 Laravel Artisan 命令无法通过 cron 作业使用

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

                <tfoot id='IbMFc'></tfoot>
                • <bdo id='IbMFc'></bdo><ul id='IbMFc'></ul>

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

                  本文介绍了自定义 Laravel Artisan 命令无法通过 cron 作业使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我通过 SSH 连接时,我有自定义的 Artisan 命令可以在本地和我的生产服务器上运行,但不能用于任何 cron 作业.我什至尝试以运行 cron 作业的用户身份运行它,并且在我的控制台上运行良好.

                  I have custom Artisan commands that run locally as well as on my production server when I am SSH'd in, but are unavailable to any cron jobs. I've even tried running it as the user the cron job runs as and it works fine from my console.

                  当我在上述设置中运行 php artisan 时,我的自定义命令会列出并可用.但是,当我将 php artisan 作为 cron 作业运行时,它们并未列出.

                  When I run php artisan in the above settings, my custom commands are listed and available. However, they are not listed when I run php artisan as a cron job.

                  此外,尝试将自定义命令 php artisan subject:calculate 作为 cron 作业运行会导致以下错误:

                  Furthermore, trying to run the custom command php artisan subjects:calculate as a cron job results in the following error:

                  <代码>[无效参数异常]
                  subjects"命名空间中没有定义命令.

                  推荐答案

                  我遇到了同样的错误,但我找到了解决方案.第一次尝试失败

                  I was fighting with the same error and I found the solution. First failed attempts

                  */5 * * * * /usr/bin/php /home/mysite/public_html/artisan my:command
                  
                  */5 * * * * php /home/mysite/public_html/artisan my:command
                  

                  解决方案

                  */5 * * * * /usr/local/bin/php /home/mysite/public_html/artisan my:command
                  

                  这篇关于自定义 Laravel Artisan 命令无法通过 cron 作业使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:PHP &amp;cron:安全问题 下一篇:调度php脚本

                  相关文章

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

                • <tfoot id='yBV2c'></tfoot>

                    <legend id='yBV2c'><style id='yBV2c'><dir id='yBV2c'><q id='yBV2c'></q></dir></style></legend>
                      <bdo id='yBV2c'></bdo><ul id='yBV2c'></ul>