【发布时间】:2018-03-13 20:53:57
【问题描述】:
这是我的 Kernel.php 代码
protected $commands = [
'App\Console\Commands\cronEmail'
];
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')->everyMinute();
}
这是我的 cronEmail.php 代码
protected $signature = 'inspire';
public function handle()
{
$name="asdfasdfasfd";
$email="asdfasdfasfd";
$phone="asdfasdfasfd";
$pass="asdfasdfasfd";
$type="asdfasdfasfd";
$discount=32542345;
$data=array("customer_name"=>$name,"customer_email"=>$email,"customer_phone"=>$phone,"customer_password"=>$pass,"customer_type"=>$type,"customer_discount"=>$discount);
DB::table('customer_det')->insert($data);
}
当我在 cmd 中运行此命令时,上面的代码工作正常
php artisan schedule:run
我尝试在 bluehost 上运行此命令,但仍然无法正常工作..!!
/usr/bin/php /home2/pakhakee/public_html/esabzi/artisan schedule:run 1>> /dev/null 2>&1
我在 bluehost 服务器上试过上面的命令,但还是不行!!
【问题讨论】: