- Plesk for Linux
How to run a PHP script using a custom PHP executable in Plesk Scheduled Tasks?
To run a PHP script using a custom PHP executable in Plesk Scheduled Tasks perform the following steps:
- Log into Plesk.
Go to Tools & Settings > Scheduled Task > Add Task .
Choose the Run a PHP script and set required version:
Click OK to save the task.
Warning: Alternatively, it is possible to do it via 'Run a command' option on the same screen. However, this is not recommended way due to security reasons as the script will be running under /bin/bash privileges.
Create a task with the type Run a command and specify the full path to custom PHP executable. Specify other settings if required.
Go to Tools & Settings > Scheduled Tasks > Settings and set the option Crontab shell to /bin/bash .
Apply the changes.
Note: it is also possible to do it per domain via Domains > example.com > Scheduled Tasks.