我创建了一个示例计划作业,以在 Laravel 5.2 中的特定时间后运行。这localhost通过artisan命令工作正常。
我在本地服务器上运行这个命令:
php artisan Demo:Cron
现在我在 HostGator 托管服务器上的 cPanel 的高级选项 cron 作业中添加此任务。但它不起作用。
这是我正在尝试的命令:
cd /home/pofindia/public_html/beta-var1/ && /usr/local/bin/php artisan Demo:Cron
PHP 版本:5.4 默认。这是我的示例文件
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use DB;
class DemoCron extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'demo:cron';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a …Run Code Online (Sandbox Code Playgroud)