Applicable to:
- Plesk for Linux
Symptoms
-
Scheduled task fails with the following error:
PLESK_ERROR: PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)
The same error is shown on panel.log with debug enabled
-
The scheduled task is created at Tools & Settings > Scheduled Tasks (Cron jobs) with Type Run a command. It should run PHP script and has no limits set with
memory_limit
directives:CONFIG_TEXT: /usr/bin/env php "/var/www/vhosts/example.com/httpdocs/index.php" "option1=qq"
Cause
PHP memory limit is exceeded.
Resolution
-
Go to Tools & Settings > Scheduled Tasks (Cron jobs) and select the affected task.
-
In the Command field, add the directive
memory_limit
with required value:CONFIG_TEXT: /usr/bin/env php "/var/www/vhosts/example.com/httpdocs/index.php" "option1=qq" -d memory_limit=128M
-
Increase
memory_limit
value server-wide in Plesk > Tools & Settings > PHP Settings > click PHP version > edit php.ini
Comments
0 comments
Please sign in to leave a comment.