Disable error_log globally, but allow users to enable it

Razva

Member
Aug 30, 2012
16
1
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!
 

Razva

Member
Aug 30, 2012
16
1
3
cPanel Access Level
Root Administrator
Ok, so users that should ENABLE error_log should have
error_log = ""
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!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
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.