Loading...


Related Products


Date Published: May 2, 2025

Errors in the PHP log

Issue

I see errors in the PHP error log.  What do they mean?

Resolution

PHP's error log is where you will find most of the problems caused by faults in PHP, whether those faults are caused by problems in the code itself, or by the code being unable to function properly due to other issues. Problems you might find include out-of-memory errors (OOM), undefined exceptions, and so on.

While you should ensure that the PHP error log is not overloaded with messages, it's also important to ensure that errors in the production environment are logged in case problems do arise. Failure to log these errors can cripple your ability to troubleshoot an issue. In most cases, disabling NOTICE messages is enough to keep the messages down to critical notifications. To suppress these, place this code into your settings.php file or if you are using Site Factory your pre-settings-php hook (see Hooks in Site Factory):

if (isset($_ENV["AH_PRODUCTION"]) && $_ENV["AH_PRODUCTION"] == 1)
{ error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); }

See the PHP page on error_reporting() for more examples. The method of suppression may change between PHP versions, so be sure to test if you update PHP.

Errors

Allowed memory size of 134217728 bytes exhausted (tried to allocate 19600 bytes) in
/mnt/www/html/sitename/docroot/modules/system/image.gd.inc on line 232

This is a memory exhaustion error and will cause a page load to fail. In this case, it's occurring in the Image module, but it can occur in a number of other modules. This error most often occurs when there's too much data or logic being processed for the standard amount of memory (128 MB) to handle. This is most commonly seen on administrative pages.

You have two possible approaches to this issue. You can troubleshoot the issue, or if you're an Acquia Cloud customer, you can increase your PHP memory limit in the UI. While it may be easier to just increase your PHP memory limit, this can have negative consequences. Higher memory levels can reduce the number of available PHP processes for handling uncached page requests. As a result of that, you may need to resize your server.

Important

Acquia recommends troubleshooting the issue whenever possible, before increasing memory limits. In the event that you need to increase your memory limit, you may find the following Help Center articles useful:

Acquia recommends that you attempt to isolate the root cause of the higher memory usage, especially if the need for memory begins to exceed 192 MB or 256 MB. Beyond this point, there are usually code or configuration changes that would be more beneficial and cost-effective. If possible, determine what code or configuration changes may have taken place that could cause a jump in memory usage. This may not be the sole culprit, as many pages behave normally until a certain point.

If you need help with troubleshooting, you may find the Help Center article on Memory consumption tracking tools  to be useful.

Note 

Overriding this globally in the site's settings.php file is not acceptable on Acquia Cloud because it creates a mismatch between the Acquia server's expected limit compared to the actual memory configured for your site, which can cause your server(s) to run out of memory if there is a traffic spike.

Look for resource-intensive queries, modules, views, or functions. Determine if anything has changed in the site's code or configuration that might have caused these alerts to suddenly appear.

Common buffer sizes

For your reference, here's a table of common large buffer sizes that you may encounter in your site's PHP error logs:

Human ReadableMathematicalLiteral (PHP logging)
128 MB227 bytes134217728 bytes
256 MB228 bytes268435456 bytes
512 MB229 bytes536870912 bytes
1 GB230 bytes1073741824 bytes
4 GB232 bytes4294967296 bytes

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation