2

I have uploaded my laravel 5.1 project on Plesk server. 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.

My Plesk Task Scheduling Interface

enter image description here

I am running schedule:run command like this

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

and in cron style i am adding this

 * * * * *

so that my cron runs every minute

When I click on run now button I get error

Error is for this line artisan file

 $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 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

Vishal Shetty
  • 1,618
  • 1
  • 27
  • 40

4 Answers4

8

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

Vishal Shetty
  • 1,618
  • 1
  • 27
  • 40
  • Hi I have tried this with php 7.4 but I keep getting the following error: ```Task "/opt/plesk/php/7.4/bin/php /var/www/vhosts/domain_name/project_name/artisan schedule:run 1>> /dev/null 2>&1" completed with error in 0 seconds.``` Is there a way to understand what the error is? – Luke Galea Sep 30 '20 at 15:43
7

Instead of 'php' try to use command '/opt/plesk/php/5.6/bin/php'

IgorG
  • 1,181
  • 6
  • 8
4

it is a quite old question but for google visitors, Here a solution with Plesk in 2022

enter image description here

Mike Aron
  • 550
  • 5
  • 13
0

Try

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