After upgrading CiviCRM to 5.69.2 (along with several extensions), I'm occasionally getting the following error:

Fatal error: Type of SmartyCompilerException::$line must be int (as in class Exception) in /home//www/www/wp-content/plugins/civicrm/civicrm/packages/smarty3/vendor/smarty/smarty/libs/sysplugins/smartycompilerexception.php on line 8

Looks like a bug in the PHP code.

Anybody else see this? Any ideas?

  • This sounds familiar. Might be an incompatibility with php 8.2?
    – Demerit
    Commented Jan 21 at 3:16
  • Maybe. I know a little PHP and the line in question reads: "class SmartyCompilerException extends SmartyException" which looks harmless and does not involve $line, but it is the first executable line in the file. I don't know anything about Smarty, but it doesn't appear to be an extension.
    – bobl
    Commented Jan 22 at 18:31
  • 1
    If you look at the definition of Exception, $line should be declared as int (or simply not redeclared). I don't know which version of php tightened things by adding the "int" or turning it from a warning into error. In general smarty3 integration with civi is still experimental. Consider turning it off in civicrm.settings.php if it's giving problems. My guess is there is some smarty2 code that is not valid in smarty3. I saw the error once when it had to do with use of the {php} tag.
    – Demerit
    Commented Jan 22 at 19:12
  • Same problem here. Setting up Smarty3 cause "Add new contact" page breaks.
    – Pál Rudan
    Commented Feb 2 at 9:56

1 Answer 1


Just a quick update on status - the Smarty2 to Smarty3 transition is still optional although at some point, once people are not hitting issues, it will be required. So if you are hitting issues then you should report them in gitlab and if you don't have time to dig into it then just switch back in the interim. We have not yet determined which release will hard-switch to Smarty3 but the absolute earliest that would be is 5.73

We have also been testing Smarty4 and from CiviCRM 5.71 Smarty 2,3 and 4 will all work. Smarty 4 seems to solve a few things and the only additional challenges from it appear to be some notices if php functions that are not registered are used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.