The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache log files growing to hundreds of gigabytes

Discussion in 'General Discussion' started by morteza, Mar 18, 2016.

  1. morteza

    morteza Member

    Joined:
    Dec 8, 2009
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hi everybody,

    Some of the accounts hosted on our cPanel servers have error_log files inside their /public_html or its subfolders, sometimes growing to 300GB or more. I'm wondering how this could be stopped so that these files wouldn't grow higher than let's say 2GB.

    I can think of cronjobs to flush these files once in a while but these files' paths would change, so it's not the best option. Fixing the errors or adding error pages on the websites also isn't an option, it's something to be done by their webmasters.

    Is there any global config or settings in Apache or maybe cPanel to manage this?

    Thank you for sharing your knowledge :)
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    324
    Likes Received:
    24
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,
    If you can change in php.ini file as below then the error logs will not stored.

    In the php.ini file
    locate
    error_reporting =
    And change the value to
    error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

    display_errors = On
    And change the value to
    display_errors = Off
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,743
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    These are the log files for PHP error messages. It's typically a good idea to review the large error_log files to determine why the log file is growing to such a large size. However, beyond that, the best way to address the issue is to setup a cron job as you mentioned.

    You may also find this thread helpful:

    Massive Error Logs and Suhosin Errors

    Thank you.
     
Loading...

Share This Page