Logo Knowledge
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  • Product Documentation
  • Insight
  • Developer Center
  • Training
  • Submit a Request
  1. Acquia Support Knowledge Base
  2. Troubleshooting
  3. Common Problem

Errors in the PHP log

    See more
    • Updated
    • June 30, 2020 05:18
    • 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:

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

    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:

    • Conditionally increasing memory limits - This can help you increase memory limits for particular processes.
    • How to change the PHP memory limit - This article explains how to change memory limits in code.

    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 Readable Mathematical Literal (PHP logging)
    128 MB 227 bytes 134217728 bytes
    256 MB 228 bytes 268435456 bytes
    512 MB 229 bytes 536870912 bytes
    1 GB 230 bytes 1073741824 bytes
    4 GB 232 bytes 4294967296 bytes

    Topics

    • logs
    • memory
    • php
    Avatar
    Byron Norris
    • June 30, 2020 05:18
    • Updated
    • Facebook
    • Twitter
    • LinkedIn

    Was this article helpful?
    2 out of 2 found this helpful

    Return to top

    Related articles

    • Conditionally increasing memory limits
    • Finding/Resolving Memory Related PHP errors in Acquia Cloud
    • PHP process exhaustion
    • Search API Processors to use with Acquia Search / Solr backends
    • Upgrading from BLT 11 to BLT 12

    Support

    Acquia Support Knowledge Base
    • Submit a Request
    • Contact Support
    • Acquia Support Guide
    • Product Documentation
    • System Status

    About Acquia

    • About Us
    • Leadership
    • Board of directors
    • Newsroom
    • Careers
    • Customers
    • Contact Us
    53 State Street, 10th Floor
    Boston, MA 02109
    United States
    Phone: 888-922-7842
    Map: Google Maps
    View other locations
    • Feeds
    • Legal
    • Security Issue?

    Copyright © 2018 Acquia Inc. All Rights Reserved. Drupal is a registered trademark of Dries Buytaert.