Articles in this section

A scheduled task configured in Plesk fails with error: PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)

Plesk for Linux kb: technical ABT: Group A

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

In case the scheduled task is using the root user identity
  1. Log in to Plesk.

  2. Go to Tools & Settings > Scheduled Tasks (Cron jobs) and select the affected task.

  3. 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

In case the scheduled task is using the domain system user identity
  1. Log into Plesk

  2. Increase memory_limit value server-wide in Plesk > Tools & Settings > PHP Settings > click PHP version > edit php.ini

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.