Plesk for Linux
kb: technical
Applicable to:
- Plesk for Linux
Symptoms
- Laravel app is installed and "composer install" has been ran at least once.
- Queues and scheduled tasks are enabled.
- The execution of 'artisan' 'schedule:run' as a scheduled task fails with the following error:
Could not open input file: /var/www/vhosts/example.com/httpdocs/artisan
- The same command works on command line with root user, but not with the system user.
- chroot is enabled for the subscription in question.
Cause
Because of the chrooted subscription, path is not defined correctly, and "artisan" file is not found.
Resolution
In the scheduled task, use the relative path, instead of the absolute path.
The correct example, with relative path.
/opt/plesk/php/8.3/bin/php '/httpdocs/artisan' 'schedule:run'
For reference, an example of absolute path, which doesn't work with chroot:
/opt/plesk/php/8.3/bin/php '/var/www/vhosts/example.com/httpdocs/artisan' 'schedule:run'
Comments
0 comments
Please sign in to leave a comment.