I am trying to run an artisan command from a cron task but I keep getting errors.
In Plesk I have created this task:
php /var/www/vhosts/domainxxx.co.uk/httpdocs/artisan schedule:run
I'm trying to run a queue
However I get an error
Could not open input file: php /var/www/vhosts/domainxxx.co.uk/httpdocs/artisan schedule:run
if I run the command php artisan schedule:run
from the httpdocs directory it works.
I've tried loads of combinations of the path and full path to php but nothing seems to work.
What am I doing wrong?
Fiddling about I created a test script in the httpdocs called crontest.php
which just echoed out a status. I'm able to get this running with cron using this command:
/usr/bin/php /var/www/vhosts/domainxxx.co.uk/httpdocs/crontest.php
The log I get shows as the domain user rather than the root user - don't know if this makes a difference? I can see the test output in the notification I receive.
Switching this to:
/usr/bin/php /var/www/vhosts/domainxxx.co.uk/httpdocs/artisan schedule:run 1
I get the error:
/usr/bin/php: No such file or directory
Confused - does this error relate to php or artisan (assume artisan as it works for the tst script). Can anyone help please. Artisan is definately there :(