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.

Disable error_log globally, but allow users to enable it

Discussion in 'General Discussion' started by Razva, Aug 30, 2012.

  1. Razva

    Razva Member

    Joined:
    Aug 30, 2012
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I've just found that some of my clients have buggy scripts that generate HUGE error_log files (like 5-8 error_logs).

    I would like to disable the error_log by default, so no error_log is created.

    Still, if a client would like to debug his script, he should have the option for enabling it for his website.

    NOTE: we're using suPHP.

    Is this possible?

    Thanks!
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Someone will correct me if I'm wrong here but I believe you could add a custom php.ini to the users root with this in it to disable logging:
    error_log = ""
     
  3. Razva

    Razva Member

    Joined:
    Aug 30, 2012
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Ok, so users that should ENABLE error_log should have
    in their php.ini?

    Isn't php.ini disabled in suPHP (just asking, I remember something about php.ini and suPHP)?

    What about the others? How can I globally disable error_log?

    Thanks!
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Actually, to globally disable it, put into the /usr/local/lib/php.ini file the following:

    Code:
    log_errors = Off
    It would typically be set to On initially. After that, you might want to restart Apache.

    As for suPHP, individual php.ini files are supported by default. As such, a user wanting to keep getting error reporting should put into their php.ini in public_html:

    Code:
    log_errors = On
    For those users, copy the full /usr/local/lib/php.ini file to their account, then change the setting for log_errors in the file.
     
Loading...

Share This Page