Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
An operation fails in Plesk with a blank page or one of the following error messages in Plesk:
PLESK_INFO: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16384 bytes) in /path/to/plesk/file.php on line 228
PLESK_INFO: 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
-
Connect to the Plesk server via SSH.
-
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
-
Increase the
memory_limit
value to 512M:CONFIG_TEXT: memory_limit = 512M
-
Save the changes and close the file.
-
Restart the Plesk management service:
# service sw-engine restart && service sw-cp-server restart
-
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. -
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
CONFIG_TEXT: /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1
with
CONFIG_TEXT: /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1 && sed -i '/memory_limit/c\memory_limit = 512M' /usr/local/psa/admin/conf/php.ini
-
on Debian/Ubuntu-based distributions
CONFIG_TEXT: /opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1
with
CONFIG_TEXT: /opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1 && sed -i '/memory_limit/c\memory_limit = 512M' /usr/local/psa/admin/conf/php.ini
-
-
Connect to the Plesk server via RDP.
-
Open the Plesk PHP configuration file
%plesk_dir%admin\conf\php.ini
in a text editor. -
Increase the
memory_limit
limit to 512. -
Save the changes and close the file.
-
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 -
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.
Comments
11 comments
I had this issue trying to delete a subscription, i followed this guide but it seems the restart of the Plesk management service does not "read" the new php.ini, in fact after the modification i tried again to delete the subscritpion but the error was the same.
Then i tried to restart Plesk services by "Plesk service monitor": i restarted the entire "Plesk run-time" and "Mail service" then tried to delete the subscription again, no luck.
Finally i restarted the server and finally i was able to delete the subscription.
@Gianluca, which limit have you specified when applying the solution?
There is a possibility that specified limit was not enough.
I have increased the limit from 256M to 512M.
@Gianluca, thank you for the provided info.
If the issue will reoccur, increase the limit further. In case it would not help, consider submitting a ticket to Plesk Technical Support.
Changes are lost after Plesk upgrade is performed (/usr/local/psa/admin/conf/php.ini is reset to default).
Please provide a persistent solution.
Hello Oleg Burca
To prevent the changes from being reverted during Plesk update, replace the following line in
/etc/cron.daily/50plesk-daily
:For Debian/Ubuntu:
/usr/local/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1
With:
/usr/local/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1 && sed -i '/memory_limit/c\memory_limit = 512M' /usr/local/psa/admin/conf/php.ini
For CentOS:
/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/c\memory_limit = 512M' /usr/local/psa/admin/conf/php.ini
If Plesk 18.0.32 on Ubuntu use the line "/opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1" still safe to change?
The error will be showing in Nexcloud app "PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 142274016 bytes)"
Solution to the problem with Nexcloud app. Upgrade MariaDB to 10.2.
Hi @Ivan Postnikov,
Can you please update the code for latest server and plesk versions?
Hello Oleg Burca
To prevent the changes from being reverted during Plesk update, replace the following line in
/etc/cron.daily/50plesk-daily
:For Debian/Ubuntu:
/usr/local/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1
With:
/usr/local/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1 && sed -i '/memory_limit/c\memory_limit = 512M' /usr/local/psa/admin/conf/php.ini
For CentOS:
/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/c\memory_limit = 512M' /usr/local/psa/admin/conf/php.ini
Hi,
I followed the instructions
but on opening, with VI of php.in, I get:
; ATTENTION!
;
; DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
; SO ALL YOUR CHANGES WILL BE LOST AFTER YOU UPGRADE PLESK.
the values can be deleted but not modified
I tried to log in with: nano but the card is empty
some advice?
Thank you
Please sign in to leave a comment.