如何在nginx vps中运行laravel调度程序
嗨,我想
在kernel.php中
protected function schedule(Schedule $schedule)
{
$schedule->job(function (){
$run= new [ ControllerName() ];
$run->index();
})->everyMinute();
}
使用VPS(Linux Ubunto 20.04 nginx)中运行Laravel Scheduler,然后在VPS中的项目位置中在终端中运行此命令(PHP Artisan计划:运行
);
我得到[2022-05-20T15:33:06+04:30]运行计划的命令:app \ http \ controllers \ crawlerController
nothig this:/ nothig happend:/
我该怎么办?
hi i want to run laravel scheduler in vps (linux ubunto 20.04 nginx)
in Kernel.php
protected function schedule(Schedule $schedule)
{
$schedule->job(function (){
$run= new [ ControllerName() ];
$run->index();
})->everyMinute();
}
then i run this command in terminal (php artisan schedule:run
) in project location in vps;
i get [2022-05-20T15:33:06+04:30] Running scheduled command: App\Http\Controllers\CrawlerController
this but nothig happend :/
what can i do to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的服务器中打开crontab -e并在代码下面粘贴,不要忘记更改cd/var/www/testproject等途径项目。
open crontab -e in your server and paste below code and don't forget to change path-to-your-project like cd /var/www/testproject.