Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    15
    Likes Received:
    1
    Trophy Points:
    3
    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:
    16,478
    Likes Received:
    421
    Trophy Points:
    583
    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 = ""
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Razva

    Razva Member

    Joined:
    Aug 30, 2012
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    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,608
    Likes Received:
    32
    Trophy Points:
    238
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice