Plesk

Unable to open the domain’s logs in Plesk: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes)

Symptoms

Cause

Due to insufficient PHP memory limit Plesk Log manager fails to process big-sized rotated log files.

Resolution

  1. Connect to the server via SSH.

  2. Increase the memory_limit value in /usr/local/psa/admin/conf/php.ini using a text editor.

    # grep 'memory_limit' /usr/local/psa/admin/conf/php.ini
    memory_limit = 512M

  3. Restart Plesk service:

    # service sw-cp-server restart

As preventive measure move the old domain logs and enable log rotation by size

  1. Connect to the server via SSH.

  2. Move old and compressed log files from logs directory with following 3 commands:

    # mkdir -p /root/oldlogs/example.com
    # find /var/www/vhosts/system/example.com/ -name '*.gz' -exec mv {} /root/oldlogs/example.com/ ;
    # find /var/www/vhosts/system/example.com/ -name '*.processed' -exec mv {} /root/oldlogs/example.com/ ;

  3. Set the log rotation as instructed on this article, e.g. by size of 5000kb.

Exit mobile version