简体   繁体   English

在 Plesk 中运行 Laravel 5.1 任务计划程序

[英]Running Laravel 5.1 Task Scheduler in Plesk

I have uploaded my laravel 5.1 project on Plesk server.我已经在 Plesk 服务器上上传了我的 laravel 5.1 项目。 I wanted to run task scheduler in Plesk, i have seen many answers on internet to do so but nothing seems to be working for me.我想在 Plesk 中运行任务调度程序,我在互联网上看到了很多这样做的答案,但似乎没有什么对我有用。

My Plesk Task Scheduling Interface我的 Plesk 任务调度界面

在此处输入图像描述

I am running schedule:run command like this我正在运行 schedule:run 这样的命令

 php  /var/www/vhosts/websitename.com/httpdocs/artisan schedule:run 1

and in cron style i am adding this在 cron 风格中,我添加了这个

 * * * * *

so that my cron runs every minute这样我的 cron 就会每分钟运行一次

When I click on run now button I get error当我单击立即运行按钮时,出现错误

错误是针对此行工匠文件

 $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

I search on internet and i found many solutions saying that it's PHP version issue, it will through error if PHP version is less or equal to PHP v5.4, but my current php version is 5.6.30 I search on internet and i found many solutions saying that it's PHP version issue, it will through error if PHP version is less or equal to PHP v5.4, but my current php version is 5.6.30

I am unable to figure it out what's the exact problem.我无法弄清楚确切的问题是什么。 Help is appreciated帮助表示赞赏

Note: I haven't added any code yet in Kernel.php file注意:我还没有在 Kernel.php 文件中添加任何代码

This way of using command works for me fine这种使用命令的方式对我很有效

 /opt/plesk/php/5.6/bin/php  /var/www/vhosts/websitename.com/httpdocs/artisan schedule:run

This is working properly in Plesk这在 Plesk 中工作正常

而不是 'php' 尝试使用命令 '/opt/plesk/php/5.6/bin/php'

Try试试

/opt/plesk/php/7.3.14/bin/php httpdocs/artisan /opt/plesk/php/7.3.14/bin/php httpdocs/artisan

it is a quite old question but for google visitors, Here a solution with Plesk in 2022这是一个相当古老的问题,但对于谷歌访问者来说,这是2022 年 Plesk的解决方案

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM