Applicable to:
- Plesk for Linux
Question
How to set the maximum execution time for a scheduled PHP script in Plesk?
Answer
In Plesk go to Tools & Settings > Scheduled Tasks > Add Task .
-
Set task type as Run a command.
-
In the Command field, put the full path to the script and specify the directive
max_execution_time
:PLESK_INFO: /usr/local/plesk/php/X.X/bin/php -f '/root/example.php' -d max_execution_time=10
where
/usr/local/plesk/php/X.X/bin/php
- path to the PHP Handler andX.X
is the handler version.max_execution_time
- time limit for script execution -
In the Run field set the the task execution time.
-
In the System user field leave user as "root" or choose another system user to run the task.
-
Click OK to create a new task.
Comments
0 comments
Please sign in to leave a comment.