Applicable to:
- Plesk for Linux
Symptoms
-
Scheduled task, e.g
httpdocs/test.php
, execution fails if clicking Run Now from the list with scheduled tasks:
The error is:
PLESK_ERROR: Task "httpdocs/test.php" completed with error in 0 seconds, output:
-: /usr/bin/php5: No such file or directory -
httpdocs/test.php
scheduled task is finished successfully when running it from the task editor:
-
Task is configured as Run a PHP script:
-
No Shell environment is set in
crontab
:# crontab -u john_doe -l
MAILTO=""
0 0 * * * /usr/bin/php5 -f 'httpdocs/test.php'
0 0 * * * /httpdocs/script.shwhen
john_doe
is the subscription system user. -
crontab_secure_shell_compatibility_mode parameter exists in Plesk database:
# plesk db "select param, val from misc where param = 'crontab_secure_shell_compatibility_mode'"
+-----------------------------------------+------+
| param | val |
+-----------------------------------------+------+
| crontab_secure_shell_compatibility_mode | true |
+-----------------------------------------+------+
Cause
The behavior is caused by two Plesk bugs related to each other which are planned to be fixed in future Plesk updates:
-
Bug with ID PPPM-7956: Different execution environment is set depending on which Run Now button is used for a Scheduled Task.
-
Bug with ID PPPM-7978: Shell is not set after switching Plesk to Power User one.
Resolution
-
Connect to the server via SSH.
-
Delete crontab_secure_shell_compatibility_mode from Plesk database:
# plesk db "delete from misc where param = 'crontab_secure_shell_compatibility_mode'"
-
Enter any scheduled task in Plesk > Domains > example.com > Scheduled Tasks >
httpdocs/test.php
> click OK without making any changes.
Comments
0 comments
Please sign in to leave a comment.