Applicable to:
- Plesk for Linux
Symptoms
-
In an attempt to run the PHP script via Plesk > Domains > example.com > Scheduled Tasks > Add Task > Run now the following error appears:
PLESK_ERROR: Task “/usr/bin/php /var/www/vhosts/example.com/httpdocs/bin/magento cron:run” completed with error in 1 seconds, output:
Could not open input file: /usr/bin/php /var/www/vhosts/example.com/httpdocs/bin/magento cron:run -
The field Script path in the task is set to
"/usr/bin/php /var/www/vhosts/example.com/httpdocs/bin/magento cron:run"
: -
The files
/usr/bin/php
and/var/www/vhosts/example.com/httpdocs/bin/magento
exist on the server:# ls -al /usr/bin/php
-rwxr-xr-x 1 root root 4618048 Nov 6 2016 /usr/bin/php# ls -la /var/www/vhosts/example.com/httpdocs/bin/magento
-rw-r–r– 1 user psacln 799 Sep 20 14:46 /var/www/vhosts/example.com/httpdocs/bin/magento
Cause
The syntaxis of the filled fields is not correct.
Resolution
Check that fields are filled correctly using this article
In this particular case, the Script path field is set wrong:
-
Script path in the task should be set to ”
/var/www/vhosts/example.com/httpdocs/bin/magento"
-
with arguments field should be filled as
"cron:run"
-
"/usr/bin/php"
should not be presented in Script path field due to the fact that PHP is defined by Use PHP version field
Additional information
Unable to execute magento command under a PHP: Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later