Allowed PHP Memory Size Exhausted

Ben Gayson
Published: 2 April 2024Last updated: 2 April 2024
Share:

What does 'PHP Memory Size Exhausted' error look like?

One common cause for a site to experience a 500 error is due to the site exhausting all of its allocated PHP memory.

image.pngUnderstanding the Error Message

The error message shown above indicates that a script on the site has used up all available PHP memory. This means there is no remaining memory for the site to carry out further operations, resulting in the 500 error.

Diagnosing PHP Memory Issues

If your site is down, checking your package error logs can help determine if it's a PHP memory issue. A message similar to the one in the image above will appear if there is a PHP memory problem.

Increasing PHP Memory Limit: A Guide

To resolve this issue, you may need to increase the PHP memory limit for your site. This adjustment can be made in the PHP Configuration section of your hosting package's control panel. A

lternatively, you can increase the PHP memory limit via your .user.ini file, especially if you're more comfortable making changes through SSH or FTP.

image.png

Standard and Recommended PHP Memory Limits

The standard PHP memory limit is set at 128M. Typically, doubling the value to 256M or 512M is sufficient. Although the maximum limit is 2048M, it's highly unusual for a site to require this amount. In most scenarios, 512M is ample for the site's needs.