我创建了一个示例计划作业,在Laravel 5.2中的特定时间之后运行.这通过artisan命令在localhost上正常工作.
我在本地服务器上运行此命令:
PHP artisan演示:Cron
现在我在HostGator托管服务器上的cPanel的高级选项cron作业中添加此任务.但它没有用.
这是我正在尝试的命令:
cd / home / pofindia / public_html / beta-var1 /&& /usr/local/bin / PHP artisan演示:Cron
<?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 new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { DB::table('items')->insert(['name'=>'hello new']); $this->info('Demo:Cron Cummand Run successfully!'); } }