Php Laravel 4.2已计划:运行命令未正确触发

Php Laravel 4.2已计划:运行命令未正确触发,php,cron,laravel-4.2,Php,Cron,Laravel 4.2,我使用Laravel4.2来调度和运行cron作业 我已经添加了我的命令,它正确地显示在php-artisan中。如果我从终端运行它,它将按预期运行 按照说明,我在crontab中添加了: ***php/home/tti/public\u html/artisan计划:运行1>/dev/null 2>&1 如果运行scheduled:summary,我可以看到如下列表: +----------------+--------------------+-----------+--------+---

我使用Laravel4.2来调度和运行cron作业

我已经添加了我的命令,它正确地显示在
php-artisan
中。如果我从终端运行它,它将按预期运行

按照说明,我在crontab中添加了:

***php/home/tti/public\u html/artisan计划:运行1>/dev/null 2>&1

如果运行
scheduled:summary
,我可以看到如下列表:

+----------------+--------------------+-----------+--------+------+--------------+-------+-------------+--------+
| Environment(s) | Name               | Args/Opts | Minute | Hour | Day of Month | Month | Day of Week | Run as |
+----------------+--------------------+-----------+--------+------+--------------+-------+-------------+--------+
| *              | cron:test          |           | *      | *    | *            | *     | *           |        |
+----------------+--------------------+-----------+--------+------+--------------+-------+-------------+--------+
下面是命令的代码:

<?php

use Indatus\Dispatcher\Scheduling\ScheduledCommand;
use Indatus\Dispatcher\Scheduling\Schedulable;
use Indatus\Dispatcher\Drivers\Cron\Scheduler;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class DatabaseBackup extends ScheduledCommand {

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'wtf:test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'This is a test.';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * When a command should run
     *
     * @param Scheduler $scheduler
     * @return \Indatus\Dispatcher\Scheduling\Schedulable
     */
    public function schedule(Schedulable $scheduler)
    {
        // return $scheduler;

        return $scheduler
            ->daily()
            ->hours(3)
            ->minutes(20);

    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function fire()
    {

        Log::info('Cron test successful');
    }


}

为什么不能正确运行?

请在问题中共享整个文件代码,而不是仅使用fire方法?另外,请让我知道你正在使用的PHP版本?你能解决这个问题吗?如果是,请分享。我也有同样的问题。@MKJ-php5.6.10;代码已更新。@Jazzbot尚未找到解决方案:(你解决了这个问题了吗,因为我能让它工作。如果你需要帮助,请告诉我。你能在你的问题中分享你的整个文件代码,而不仅仅是fire方法吗?另外,请让我知道你正在使用的PHP版本吗?你能解决这个问题吗?如果是,那么请分享。我也有同样的问题。@MKJ-php5.6。10、 代码已更新。@Jazzbot尚未找到解决方案。:(您是否已修复该问题,因为我可以使其正常工作。如果您需要帮助,请告诉我。
local.ERROR: exception 'InvalidArgumentException' with message 'There are no commands defined in the "wtf" namespace.' in /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:514
Stack trace:
#0 /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(548): Symfony\Component\Console\Application->findNamespace('wtf')
#1 /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(188): Symfony\Component\Console\Application->find('wtf:databasebac...')
#2 /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(121): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/tti/public_html/artisan(58): Symfony\Component\Console\Application->run()
#4 {main} [] []
[2016-08-13 15:35:01] local.ERROR: exception 'InvalidArgumentException' with message 'There are no commands defined in the "wtf" namespace.' in /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php:514
Stack trace:
#0 /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(548): Symfony\Component\Console\Application->findNamespace('cron')
#1 /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(188): Symfony\Component\Console\Application->find('wtf:databasebac...')
#2 /home/tti/public_html/vendor/symfony/console/Symfony/Component/Console/Application.php(121): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/tti/public_html/artisan(58): Symfony\Component\Console\Application->run()
#4 {main} [] []