- Plesk for Linux
When running a PHP script at Scheduled Tasks, one of the following errors appears:
PLESK_ERROR: Task "php -q /var/www/vhosts/example.com/crons/test.php -option1" completed with error in 0 seconds. See Details
-: php: command not found
PLESK_ERROR: The file /var/www/vhosts/example.com/httpdocs/billing/crons/cron.php was encoded with the PHP 5.6 ionCube Encoder and requires PHP 5.6 to be installed.
PHP version 5.6 or higher is required to run the PHP script.
System PHP version is 5.4:
# php -v
PHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.18, Copyright (c) 2002-2015, by ionCube Ltd.
A system PHP binary is specified in the scheduled task, while a higher version should be used to run the PHP script:
If the option Task type is set as Run a command and a PHP binary is specified as
php, the system PHP will be used to run the command.
If the option Task type is set as Run a PHP script, Plesk will use the system PHP to run the command.
Connect to a Plesk server via SSH.
Get the list of all installed PHP handlers:
# plesk bin php_handler --list
Find a required PHP version and copy its path under the php-cli column. For example, if the PHP script requires the PHP version 5.6, the path will be
In Plesk go to Scheduled Tasks > Add Task:
Set the option Task type as Run a command.
Paste the path from the step 2 to the Command field. The full command should look like:
PLESK_INFO: /opt/plesk/php/5.6/bin/php /var/www/vhosts/example.com/httpdocs/billing/crons/cron.php
- Click OK to create the task.