Scheduled task fails with error:
PLESK_ERROR: PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)
The scheduled task is created at Tools & Settings > Scheduled Tasks with Type Run a command. It should run PHP script and has no limits set with
/usr/bin/env php "/var/www/vhosts/example.com/httpdocs/index.php" "option1=qq"
PHP memory limit is exceeded.
In case the scheduled task is using the root user identity
Go to Tools & Settings > Scheduled Tasks and select the affected task.
In the Command field, add the directive
memory_limitwith required value:
/usr/bin/env php "/var/www/vhosts/example.com/httpdocs/index.php" "option1=qq" -d memory_limit=128M
In case the scheduled task is using the domain system user identity
memory_limitvalue server-wide in Plesk > Tools & Settings > PHP Settings > click PHP version > edit php.ini