Hello/Hi/Greetings,
I tried to run piwigo 12 on PHP8. The very first request it served was:
66.249.65.67 - - [08/Nov/2021:00:45:04 +0300] "GET <prefix>/index.php?/categories HTTP/1.1" 200 825 "-" "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" "2.21"
And it resulted in
2021/11/08 00:45:04 [error] 5116#5116: *12534 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in [webapp-root]/themes/smartpocket/themeconf.inc.php:122 Stack trace: #0 [webapp-root]/themes/smartpocket/themeconf.inc.php(122): implode() #1 [webapp-root]/include/functions_plugins.inc.php(264): sp_end_section_init() #2 [webapp-root]/include/section_init.inc.php(651): trigger_notify() #3 [webapp-root]/index.php(12): include('...') #4 {main} thrown in [webapp-root]/themes/smartpocket/themeconf.inc.php on line 122" while reading response header from upstream, client: 66.249.65.67, server: www.unseen.photo, request: "GET <prefix>/index.php?/categories HTTP/1.1", upstream: "<socket-address>", host: "www.unseen.photo"
Does piwigo 12.0.0 supposed to run on PHP8?
Piwigo 12.0.0 Check for upgrade
Operating system: Linux
PHP: 8.0.12 (Show info) [2021-11-07 22:24:51]
MySQL: 5.5.5-10.5.10-MariaDB-log [2021-11-08 01:24:51]
Graphics Library: External ImageMagick 7.1.0-5
Cache size 153.12 Mo calculated 1 day ago Refresh
Piwigo URL: https://unseen.photo
Offline
Can you make this test?
In file themes/smartpocket/themeconf.inc.php, line 122, replace:
'tags_string' => @implode(',', @$page['tag_ids']),
by
'tags_string' => (isset($page['tag_ids']) ? implode(',', $page['tag_ids']) : ''),
And tell us if it's fine for you.
Offline
That very fatal error has (of course) gone but the installation became completely unusable.
First, the login is broken. If I enter a correct login:password pair, I get the "Invalid username and password!" error in the webpage and this in the logs (slightly formatted):
2021/11/11 23:10:12 [error] 5119#5119: *21476 FastCGI sent in stderr: " age: PHP Warning: Undefined array key "TITLE" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_menu.tpl.php on line 47 PHP message: PHP Warning: Undefined array key "Version" in [webapp-root]/_data/templates_c/<cache-prefix>.file.rightClick_protect.tpl.php on line 33" while reading response header from upstream, client: <my IP>, server: www.unseen.photo, request: "POST /gallery/identification.php HTTP/2.0", upstream: "<php-fpm socket>", host: "unseen.photo", referrer: "https://unseen.photo/gallery/index.php?/categories"
I believe, "age:" is a fragment of "PHP message:" string.
Second, the compiled templates (on any page) produce tons of the same warnings of the type: "Undefined array key", with any theme, on any page. These warnings are also partly rendered as part of html in many contexts, not only creating a visual mess for the user but also infiltrating to URLs. For example, this way have been looking one link (I don't remember where exactly I clicked, I extracted the URL from by browser's history, but there were many such instances): "https://www.unseen.photo/gallery/%3Cbr%20/%3E%3Cb%3EWarning%3C/b%3E:%20%20Undefined%20array%20key". The part after the [webapp-prefix] is the URL-encoded string "<br /><b>Warning</b>: Undefined array key".
Since I have had many plugins which produced that warnings (actually, errors), I also temporarily deactivated all plug-ins except those bundled with piwigo and once again purged the templates cache. This made the havoc even worse, any access resulted in HTTP 502 error (Bad gateway) with the following runaway in the logs:
2021/11/11 23:57:07 [error] 5119#5119: *21548 FastCGI sent in stderr: " PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/<cache-prefix>.file.menubar_tags.tpl.php on line 37 PHP message: PHP Warning: Undefined array key "level" in [webapp-root]/_data/templates_c/... 2021/11/11 23:57:07 [error] 5119#5119: *21548 upstream sent too big header while reading response header from upstream, client: <my IP>, server: www.unseen.photo, request: "GET /gallery/index.php?/categories HTTP/2.0", upstream: "<php-fpm socket>", host: "unseen.photo
I experimented on a "production" server, so I just gave a try for few minutes in the night. I can set up a staging server for experimentation if this helps. Unfortunately I know nothing of smarty and the last time I did some programming in PHP was almost 20 years ago, so I am not sure if I can be really useful in debugging but I am ready to at least check things if they are not reproducible on an average install.
Offline