Laravel 5.4 Cron执行我在服务器上不执行的命令(CPanel)

时间:2019-02-18 07:45:53

标签: php laravel-5 cron shared-hosting

创建并注册了测试命令,如下所示 app\console\commands\Update.php个文件:

`

//signature
protected $signature = 'Thumi';
…….
//handle to execute console command
public function handle()
{
    $user = User::findOrFail(6);

    $user->update(['fname' => 'kennnn']);   
}

app \ console \ Kernel.php

/**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        Commands\Update::class
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('Thumi')
                 ->everyFiveMinutes();
    } 

`

命令正在localhost的CLI上执行。 Php artisan Thumi 以下是我在Cpanel分支中插入的命令。 */5 * * * * /usr/local/bin/php /home/bladeres/public_html/WMS/artisan schedule:run >> /dev/null 2>&1 忽略电子邮件通知。另外,我将php版本更改为7.1,这可能是共享主机提供商的原因还是问题?

0 个答案:

没有答案