PHP 5.3 and Typo3 4.3 - t3lib_error_Exception


If you are already using PHP 5.3.x and you’ve just upgraded to Typo 4.3 or greater, Typo3 might start throwing exceptions where previously everything had worked out just fine.

This is because the Typo3 developers chose to take some of the error handling into their own hands and raise exceptions for certain errors. Now these “certain errors” for which exceptions are raised include E_DEPRECATED, and as a bunch of functions have been deprecated in PHP 5.3, well, you know where I’m going with this.

Fortunately, there is a configuration variable which allows to change the default behavior:

$TYPO3_CONF_VARS['SYS']['exceptionalErrors']

The default value (defined in “t3lib/config_default.php”) is

E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^ E_USER_NOTICE ^ E_USER_WARNING

To disable the deprecation exceptions, just add a ^ E_DEPRECATED like this (the line goes in your localconf.php file):

$TYPO3_CONF_VARS['SYS']['exceptionalErrors'] = E_ALL ^ E_NOTICE ^ E_WARNING ^ E_USER_ERROR ^ E_USER_NOTICE ^ E_USER_WARNING ^ E_DEPRECATED;

Thanks to this guy (link in German) for sending me onto the right path.