stormy Posted August 7, 2013 Share Posted August 7, 2013 I've run into an interesting problem with the "Display errors" setting in General Settings > Other. My server is configured to not display errors and log them to an error log, which I think is the only sane choice However, WHMCS doesn't log errors. The "Display errors" setting overrides everything: If I turn it on, errors are displayed to users, and logged. This means any PHP error will show and totally break the site. Not a good idea. If I turn it off, errors are not displayed NOR logged to the error_log. Not a good idea either. No matter what my php.ini settings are, and no matter what I specify via .htaccess, this setting overrides it all. Has anybody succeeded in overriding this? This is from WHMCS support: "If Display errors is enabled it will run:error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING); If Display errors isn't enabled it will run: error_reporting(0);" With the normal php error settings this will display on the screen, to have this log to a file this would require adjusting your php configuration settings (This isn't something we can support as we are not system administrators) I pointed out that this can't be done, and I was told to put in a feature request 0 Quote Link to comment Share on other sites More sharing options...
markc Posted March 13, 2014 Share Posted March 13, 2014 So has there been any resolution to this issue after 6 months? I'm trying the develop a theme and I've run into the same problem, no error_log() output no matter what I add to php.ini. 0 Quote Link to comment Share on other sites More sharing options...
stormy Posted March 13, 2014 Author Share Posted March 13, 2014 Turns out there is a solution. You can create a hook that enables error reporting: <?php ini_set("error_reporting", E_ALL & ~E_NOTICE & ~E_DEPRECATED); ini_set("log_errors", 1); ?> 0 Quote Link to comment Share on other sites More sharing options...
jcncnc Posted August 5, 2015 Share Posted August 5, 2015 (edited) Just a quick question here if perhaps someone can answer it... I'd really appreciate it. I turned on Display Errors today through WHMCS Admin - General Settings/Other and when I hit Submit, suddenly the whole site became the display of one error. Now I can't see any page on the site - all you see is this one error message. Prior to this, the site worked fine. I went into the database through phpmyadmin and changed "DisplayErrors" from 'on' to 'off' in the tblconfiguration table. But when I did that - now any page on the site says it can't load because there are too many redirect loops! When I turn "DisplayErrors" back to 'on' in the whmcs database, it goes back to displaying the one error... but still no site. Does anyone have any idea how I can turn Display Errors back off in a way that will make the site visible again? Thanks so much! Edited August 5, 2015 by jcncnc 0 Quote Link to comment Share on other sites More sharing options...
hostingireland Posted June 23, 2016 Share Posted June 23, 2016 Turns out there is a solution. You can create a hook that enables error reporting: <?php ini_set("error_reporting", E_ALL & ~E_NOTICE & ~E_DEPRECATED); ini_set("log_errors", 1); ?> But then the question is in which hook it should be set (it works only till the end of the script in which the hook is executed). If in all of them, the activity log grows just too quick. Our solution is to create custom public_html/init.php file which looks like the following: <?php require_once 'init_real.php'; require_once 'error_logging.php'; where init_real.php is the original WHMCS init.php file and error_logging.php looks like this: <?php require_once 'error_logging_level.php'; ini_set("error_reporting", ERROR_LOGGING_LEVEL); ini_set("log_errors", 1); and of course error_logging_level which might be different in production and development environment: DEVELOPMENT: <?php define('ERROR_LOGGING_LEVEL', E_ALL); PRODUCTION: <?php define('ERROR_LOGGING_LEVEL', E_ALL & ~E_NOTICE & ~E_STRICT); This is only a temporary solution. Hopefully WHMCS will come up with some better way of handling error logging. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.