Debugging

Simply add this to your localconf.php file (<root>/typo3conf/localconf.php):


$TYPO3_CONF_VARS['SYS']['devIPmask'] = 'your_ip_address,::1';
$TYPO3_CONF_VARS['SYS']['displayErrors'] = '2';

This should provide you with some meaningful error messages instead of blank pages.

$TYPO3_CONF_VARS[‘SYS’][‘displayErrors’] can have these values: -1, 0, 1, 2 which translates to:

-1 Default setting. With this option, you can override the PHP setting “display_errors”. If devIPmask matches the users IP address the configured “debugExceptionHandler” is used for exceptions, if not “productionExceptionHandler” will be used.
0 Do not display any PHP error messages. Overrides the value of “exceptionalErrors” and sets it to 0 (= no errors are turned into exceptions),the configured “productionExceptionHandler” is used as exception handler
1 Display error messages with the registered error handler, the configured “debugExceptionHandler” is used as exception handler
2 Display errors only if client matches TYPO3_CONF_VARS[SYS][devIPmask]. If devIPmask matches the users IP address the configured “debugExceptionHandler” is used for exceptions, if not “productionExceptionHandler” will be used.

So we chose to display error messages only to certain IP adresses specified in $TYPO3_CONF_VARS[‘SYS’][‘devIPmask’].

Additionally we might want to add these flags to localconf.php file:


$TYPO3_CONF_VARS['SYS']['sqlDebug'] = '1';
$TYPO3_CONF_VARS['BE']['debug'] = '1';
$TYPO3_CONF_VARS['FE']['debug'] = '1';

$TYPO3_CONF_VARS[‘SYS’][‘sqlDebug’] sets sql debugging level. Possible values are:

0 no SQL shown (default)
1 show only failed queries
2 show all queries

$TYPO3_CONF_VARS[‘BE’][‘debug’] is new mode for debugging added with Typo3 4.5:

“A new mode was added to debug the backend with $TYPO3_CONF_VARS[‘BE’][‘debug’] = ‘1’; it disables the login refresh ajax call and instructs the page renderer not to merge the loaded javascript and CSS files, easing debugging with tools like Firebug.”

Source Typo3 Wiki.

$TYPO3_CONF_VARS[‘FE’][‘debug’] should enable frontend debugging.

Additionaly, Typo3 stores frontend and backend errors in sys_log database table. You might want to store these in some separate log file:

$TYPO3_CONF_VARS['SYS']['systemLogLevel'] = '0';
$TYPO3_CONF_VARS['SYS']['systemLog'] = 'error_log';

$TYPO3_CONF_VARS[‘SYS’][‘systemLogLevel’] defines verbosity levels:

0 info
1 notice
2 warning
3 error
4 fatal error

And $TYPO3_CONF_VARS[‘SYS’][‘systemLog’] defines logging method:

file file,<abs-path-to-file>[,<severity>] log to a file
mail mail,<to>[/<from>][,<severity>] send log entries via mail
syslog syslog,<facility>,[,<severity>] use the operating system’s log. Facility may be one of LOCAL0 .. LOCAL7, USER (on Windows USER is the only valid type).
error_log error_log[,,<severity>] use PHP error log

Remember to turn these off in production environment.