Loading...
 
Architecture / Installation

Architecture / Installation


PHP 8.0 issues

posts: 1 United States

Upgrading PHP from version 7.4 to 8.0 causes some issues in TikiWiki 22.1.

Most everything on the site seems to work for the most part, at least to the users. However, when I try to view the /tiki-admin.php?page=look page, the "head" section is missing in the source code, so no CSS or anything else is loaded on the page, causing it to be partially visible.

So, to chase down the issue, I cleared my error.log file, cleared my browser cache, and reloaded the page.

The first ten lines of errors were pretty simple to fix myself:

[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $defaultLanguage follows optional parameter $prefix in /home/vendor_bundled/vendor/h5p/h5p-editor/h5peditor.class.php on line 376
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $global_ref follows optional parameter $var_names in /home/lib/tikilib.php on line 4441
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $contributions follows optional parameter $type in /home/lib/logs/logslib.php on line 1285
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $contributions follows optional parameter $type in /home/lib/logs/logslib.php on line 1310
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $contributions follows optional parameter $type in /home/lib/logs/logslib.php on line 1339
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $contributions follows optional parameter $type in /home/lib/logs/logslib.php on line 1367
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $name follows optional parameter $moduleId in /home/lib/modules/modlib.php on line 101
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $title follows optional parameter $moduleId in /home/lib/modules/modlib.php on line 101
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $position follows optional parameter $moduleId in /home/lib/modules/modlib.php on line 101
[15-Aug-2021 09:56:47 America/Chicago] PHP Deprecated:  Required parameter $order follows optional parameter $moduleId in /home/lib/modules/modlib.php on line 101


All I needed to do was add " = '' " to each of those function parameters.

However, I was still getting some issues.

The rest of the messages I found in the error log were all based on the "Smarty Templates" vendor package:

[15-Aug-2021 09:56:47 America/Chicago] PHP Fatal error:  Uncaught TypeError: implode(): Argument #1 ($separator) must be of type string, array given in /home/temp/templates_c/en_basic^9a8118ecf300ed2e12307d808e8853cc0d46e5b5_0.file.shared.tpl.php:62
Stack trace:

#0 /home/temp/templates_c/en_basic^9a8118ecf300ed2e12307d808e8853cc0d46e5b5_0.file.shared.tpl.php(62): implode()
#1 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_61192b2fe3a7e5_54939180()
#2 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#3 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#4 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()

#5 /home/temp/templates_c/en_basic^d00fe85f9d1816a35077877c6a3effc95754c49e_0.file.multilist.tpl.php(50): Smarty_Internal_Template->_subTemplateRender()
#6 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_61192b2fdf3c58_49169882()
#7 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#8 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#9 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render()
#10 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
#11 /home/lib/smarty_tiki/function.preference.php(95): Smarty_Internal_TemplateBase->fetch()

#12 /home/temp/templates_c/en_basic^f555e54b6c7c948822115dd7bf9d50b99d6851b3_0.file.include_look.tpl.php(90): smarty_function_preference()
#13 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_61192b2fae7160_74808710()
#14 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#15 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#16 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()

#17 /home/temp/templates_c/en_basic^04b0a856f8829759be95668be067d0081d940477_0.file.tiki-admin.tpl.php(205): Smarty_Internal_Template->_subTemplateRender()
#18 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_61192b2f9dc315_42833888()
#19 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#20 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#21 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render()
#22 /home/vendor_bundled/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()

#23 /home/lib/init/smarty.php(283): Smarty_Internal_TemplateBase->fetch()
#24 /home/lib/init/smarty.php(508): Smarty_Tiki->fetch()
#25 /home/lib/init/smarty.php(452): Smarty_Tiki->assign_layout_sections()
#26 /home/tiki-admin.php(723): Smarty_Tiki->display()
#27 {main}
  thrown in /home/temp/templates_c/en_basic^9a8118ecf300ed2e12307d808e8853cc0d46e5b5_0.file.shared.tpl.php on line 62


I line-spaced some of those messages to break it up for easier viewing.

I'm sure I could find those parts that are causing the issues and fix it, but I think it would be better if the TikiWiki people did it.

Looking at the version of the Smarty Template Engine used in Tikiwiki 22.1, it is ver 3.1.33-Dev, which was released on 2018-3-9. The current version (at the time of this writing) of Smarty Template Engine is 3.1.39, which was released on 2021-02-17, making the current version used in TikiWiki about three years old.

The Smarty Template Engine Developers fixed the version 8.x problem in version 3.1.37, which was released on 2021-01-07.

I need PHP 8.0 for my other sites I am working on, so I can not switch back to PHP 7.4.

Thanks for your attention!

Walter Whitman
The Joyful Programmer




posts: 22 Lithuania
Walter Whitman wrote:

Upgrading PHP from version 7.4 to 8.0 causes some issues in TikiWiki 22.1.

Most everything on the site seems to work for the most part, at least to the users.


Very good news!

Walter Whitman wrote:

Upgrading PHP from version 7.4 to 8.0 causes some issues in TikiWiki 22.1.

I need PHP 8.0 for my other sites I am working on, so I can not switch back to PHP 7.4.


Not to confuse other users - it is not a must to have PHP 8.0 for all of your sites.
Eg I have got wordpress sites with PHP 8.0 and Tiki sites working with php 7.4 in parallel. Using FPM, btw. They work with either apache or nginx. Or, best, combined with proxies. I prefer nginx for frontend lately because it gives extra easy configuration for throttling requests.

Regards, Aris