Plesk

Operations in Plesk fail: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)

Symptoms

An operation fails in Plesk with a blank page or one of the following error messages in Plesk:

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16384 bytes) in /path/to/plesk/file.php on line 228


Out of memory (allocated 23855104) (tried to allocate 12975879 bytes) (Abstract.php:41)

Cause

Memory limit is exceeded by Plesk PHP back-end. This may happen if an object, over which the operation is performed, has a complex structure.

Resolution

 

For Plesk on Linux

 

  1. Connect to the Plesk server via SSH.

  2. Open the Plesk PHP configuration file php.ini in a text editor. In this example, we are using the vi editor:

    # vi /usr/local/psa/admin/conf/php.ini

  3. Increase the memory_limit value to 512M:

    memory_limit = 512M

  4. Save the changes and close the file.

  5. Restart the Plesk management service:

    # service sw-engine restart && service sw-cp-server restart

  6. Redo the previously failed operation. If it fails with the same error, increase the memory_limit limit to a greater value and restart the services.

  7. To prevent the changes from being reverted during Plesk update, replace the following line in /etc/cron.daily/50plesk-daily using a text editor:

    • on CentOS/RHEL-based distributions

      /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1

      with

      /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1 && sed -i '/memory_limit/cmemory_limit = 512M' /usr/local/psa/admin/conf/php.ini

    • on Debian/Ubuntu-based distributions

      /opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1

      with

      /opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1 && sed -i '/memory_limit/cmemory_limit = 512M' /usr/local/psa/admin/conf/php.ini

 

For Plesk on Windows Server

 

  1. Connect to the Plesk server via RDP.

  2. Open the Plesk PHP configuration file %plesk_dir%adminconfphp.ini in a text editor.

  3. Increase the memory_limit limit to 512.

  4. Save the changes and close the file.

  5. Restart the Plesk management service:

    Start PowerShell and run the commands one by one:

    PS import-module WebAdministration
    net stop "Plesk PopPass Service"
    net stop "Plesk Management Service"
    net start "Plesk Management Service"
    net start "Plesk PopPass Service"
    Restart-WebAppPool PleskControlPanel

  6. Redo the previously failed operation. If it fails with the same error, increase the memory_limit limit to a greater value and restart the services.

 

Exit mobile version