Smarty fatal error on new server

pjohanneson
Thu, 23 Oct 2025 21:20:15 +0000
Software Support

I’m trying to move an OJS installation from one server to another.

The old server is running PHP 7.4, the new one PHP 8.3.

I’ve exported the old server’s database and imported it on the new site, I’ve installed OJS 3.3.0-21 on the new site, and I’ve set the permissions up correctly. I ran the php tools/upgrade.php upgrade.

When I go to the site, the home page loads properly, but if I try to click into either of the two journals hosted on the server, I get a 500 error and the following turns up in the Apache error log:

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/cache/t_compile/00a0a0910209607cb33eb0fe6474f30ed7399ed7^10ae5578a0959129b8d4ceeb9f99c1bb2a9cbd65_0.app.frontendcomponentsheader.tpl.php:79
Stack trace:
#0 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_68fa8c07e504b2_59040486()#1 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#2 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()
#3 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(386): Smarty_Internal_Template->render()
#4 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/cache/t_compile/00a0a0910209607cb33eb0fe6474f30ed7399ed7^e64e579388e5615e11e939b12134d6ae8679eba6_0.app.frontendpagesindexJournal.tpl.php(29): Smarty_Internal_Template->_subTemplateRender()
#5 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_68fa8c07e3d6e6_15029933()#6 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#7 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render()
#8 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render()#9 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute()
#10 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/classes/template/PKPTemplateManager.inc.php(1250): Smarty_Internal_TemplateBase->display()
#11 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/pages/index/IndexHandler.inc.php(67): PKPTemplateManager->display()
#12 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/classes/core/PKPRouter.inc.php(397): IndexHandler->index()
#13 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/classes/core/PKPPageRouter.inc.php(246): PKPRouter->_authorizeInitializeAndCallRequest()
#14 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/classes/core/Dispatcher.inc.php(144): PKPPageRouter->route()
#15 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/lib/pkp/classes/core/PKPApplication.inc.php(360): Dispatcher->dispatch()
#16 /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/index.php(68): PKPApplication->execute()
#17 {main}
  thrown in /srv/www/vhosts/journals.example.com/ojs-3.3.0-21/cache/t_compile/00a0a0910209607cb33eb0fe6474f30ed7399ed7^10ae5578a0959129b8d4ceeb9f99c1bb2a9cbd65_0.app.frontendcomponentsheader.tpl.php on line 79, referer: https://journals.example.com/

It seems like Smarty isn’t behaving properly; I’m not sure, but it could be a PHP 8 issue.

Any suggestions?

6 posts - 2 participants