Deprecated warnings appear when used with php 8.1.6 #1454

Closed
opened 2026-10-05 00:44:32 +02:00 by adam · 9 comments
Owner

Hello,As part of a testing project under a software testing course at University Malaya we are currently testing piwigo.We have found several deprecated warnings when piwigo is used with PHP version 8.1.6 or higher. We hope you will look into this matter further

Hello,As part of a testing project under a software testing course at University Malaya we are currently testing piwigo.We have found several deprecated warnings when piwigo is used with PHP version 8.1.6 or higher. We hope you will look into this matter further <!-- github-sync-id:1248265281 -->
adam closed this issue 2026-10-05 00:44:32 +02:00
Author
Owner

I upgraded from Fedora 35 to 36 and ran headlong into this issue. However I was able to find a workaround. You can switch from php 8.1.6 to 7.4.29. This uses a Modular Repository. The instructions for Fedora 36 are as follows:

sudo dnf -y install http://rpms.remirepo.net/fedora/remi-release-36.rpm
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --set-disabled remi
sudo dnf config-manager --set-enabled remi-modular
sudo dnf module reset php
sudo dnf remove php\*
sudo dnf module install php:remi-7.4
sudo dnf -y install php-common php-mbstring php-cli php-pdo php-xml php-fedora-autoloader php-fpm php-opcache php-process php-pear php-sodium php php-gd php-pear-Mail-Mime php-mysqlnd php-Smarty
sudo systemctl enable --now php-fpm
sudo systemctl restart httpd

For reference I gleaned this solution from: https://computingforgeeks.com/how-to-install-php-on-fedora/

I upgraded from Fedora 35 to 36 and ran headlong into this issue. However I was able to find a workaround. You can switch from php 8.1.6 to 7.4.29. This uses a Modular Repository. The instructions for Fedora 36 are as follows: ``` sudo dnf -y install http://rpms.remirepo.net/fedora/remi-release-36.rpm sudo dnf -y install dnf-plugins-core sudo dnf config-manager --set-disabled remi sudo dnf config-manager --set-enabled remi-modular sudo dnf module reset php sudo dnf remove php\* sudo dnf module install php:remi-7.4 sudo dnf -y install php-common php-mbstring php-cli php-pdo php-xml php-fedora-autoloader php-fpm php-opcache php-process php-pear php-sodium php php-gd php-pear-Mail-Mime php-mysqlnd php-Smarty sudo systemctl enable --now php-fpm sudo systemctl restart httpd ``` For reference I gleaned this solution from: https://computingforgeeks.com/how-to-install-php-on-fedora/ <!-- github-comment-id:1139947875 -->
Author
Owner

This should be considered a bug

The file include/config_default.inc.php contains this line:
$conf['show_php_errors'] = E_ALL;

This causes all diagnostic messages to be displayed on the user's page, which is a poor user experience and bad practice, especially with the variety of changes happening in recent PHP versions. This can be fixed on a site-by-site basis by using the LocalTools Editor Plugin but this solution was not obvious and required considerable time to diagnose.

An OK solution would be for Piwigo to use either _E_ERRORS or use the old PHP default of: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED.

An even better solution would be to accept the values specified by PHP.ini and USER.ini since these are standard + well-known files, why is Piwigo adding complexity and causing confusion through the use of a separate file of PHP overrides?

This should be considered a bug The file **include/config_default.inc.php** contains this line: `$conf['show_php_errors'] = E_ALL;` This causes **all** diagnostic messages to be displayed on the user's page, which is a poor user experience and bad practice, especially with the variety of changes happening in recent PHP versions. This can be fixed on a site-by-site basis by using the LocalTools Editor Plugin but this solution was not obvious and required considerable time to diagnose. An OK solution would be for Piwigo to use either _E_ERRORS or use the old PHP default of: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED. An even better solution would be to accept the values specified by PHP.ini and USER.ini since these are standard + well-known files, why is Piwigo adding complexity and causing confusion through the use of a separate file of PHP overrides? <!-- github-comment-id:1186377322 -->
Author
Owner

The presence of this error also, for some reason, made it impossible to assign a photo to an album. No album names were presented in the dropdown when trying to move a photo to an album. When I modified include/config_default.inc.php to not show errors, my album assignment problem went away.

The presence of this error also, for some reason, made it impossible to assign a photo to an album. No album names were presented in the dropdown when trying to move a photo to an album. When I modified include/config_default.inc.php to not show errors, my album assignment problem went away. <!-- github-comment-id:1207558663 -->
Author
Owner

We have made many changes on branch master last months to be compatible with PHP 8.0 and 8.1. Do the problems still occur? (you can try branch master or directly Piwigo 13.0.0RC4.

We have made many changes on branch `master` last months to be compatible with PHP 8.0 and 8.1. Do the problems still occur? (you can try branch `master` or directly Piwigo 13.0.0RC4. <!-- github-comment-id:1260822588 -->
Author
Owner

Piwigo 3.14.0:
I still have these warning in php 8.0/8.1

Warning: Undefined array key "MODUS_CSS_VERSION" in /.../_data/templates_c/8bo4ru_1uwy3cn^c3c24811e3108d229528ea7436f37d546424ffb3_0.file.header.tpl.php on line 88

Warning: Attempt to read property "value" on null in /.../_data/templates_c/8bo4ru_1uwy3cn^c3c24811e3108d229528ea7436f37d546424ffb3_0.file.header.tpl.php on line 88

Warning: Undefined array key 2 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 72

Warning: Undefined array key 3 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 77

Warning: Undefined array key 4 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 82

Warning: Undefined array key 1 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 87`

Piwigo 3.14.0: I still have these warning in php 8.0/8.1 Warning: Undefined array key "MODUS_CSS_VERSION" in /.../_data/templates_c/8bo4ru_1uwy3cn^c3c24811e3108d229528ea7436f37d546424ffb3_0.file.header.tpl.php on line 88 Warning: Attempt to read property "value" on null in /.../_data/templates_c/8bo4ru_1uwy3cn^c3c24811e3108d229528ea7436f37d546424ffb3_0.file.header.tpl.php on line 88 Warning: Undefined array key 2 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 72 Warning: Undefined array key 3 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 77 Warning: Undefined array key 4 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 82 Warning: Undefined array key 1 in /.../_data/templates_c/8bo4ru^7cea592546924a50b85a1f9a50e3632aa4eb32c1_0.file.mainpage_categories.tpl.php on line 87` <!-- github-comment-id:1369758727 -->
Author
Owner

I'm still seeing this in Piwigo 13.5.0 using PHP 8.1.14

Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383
Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383
Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383
Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383
Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383
Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383
Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383
Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383
Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383
Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383
Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383
Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383
Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383
Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383
Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383
Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383
Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383
Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383
Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383
Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383
Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383

I'm still seeing this in Piwigo 13.5.0 using PHP 8.1.14 Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383 Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383 Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383 Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383 Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383 Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383 Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383 Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383 Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383 Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383 Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383 Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383 Warning: Undefined array key "day" in /usr/local/www/admin/intro.php on line 383 Warning: Trying to access array offset on value of type null in /usr/local/www/admin/intro.php on line 383 Deprecated: mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/local/www/admin/intro.php on line 383 <!-- github-comment-id:1405828015 -->
Author
Owner

With PHP 8.2.7, we also have this warning

2023/06/24 10:42:58 [error] 9155#0: *44 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "comments" in /usr/files/www/html/fotos/_data/templates_c/ljbwkp^7380997732dbdb7c8246c6e2f
9e1d31e5fbe18b2_0.file.comment_list.tpl.php on line 59; PHP message: PHP Warning: Attempt to read property "value" on null in /usr/files/www/html/fotos/_data/templates_c/ljbwkp^7380997732dbdb7c8246c6e2
f9e1d31e5fbe18b2_0.file.comment_list.tpl.php on line 59" while reading response header from upstream, client: 92.106.188.192, server: r8.casymir.ch, request: "GET /fotos/picture.php?/538/category/50 HTT
P/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "generic.casymir.ch", ...

With PHP 8.2.7, we also have this warning 2023/06/24 10:42:58 [error] 9155#0: *44 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "comments" in /usr/files/www/html/fotos/_data/templates_c/ljbwkp^7380997732dbdb7c8246c6e2f 9e1d31e5fbe18b2_0.file.comment_list.tpl.php on line 59; PHP message: PHP Warning: Attempt to read property "value" on null in /usr/files/www/html/fotos/_data/templates_c/ljbwkp^7380997732dbdb7c8246c6e2 f9e1d31e5fbe18b2_0.file.comment_list.tpl.php on line 59" while reading response header from upstream, client: 92.106.188.192, server: r8.casymir.ch, request: "GET /fotos/picture.php?/538/category/50 HTT P/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "generic.casymir.ch", ... <!-- github-comment-id:1605311697 -->
Author
Owner

Those bugs should be fixed in Piwigo 14

Those bugs should be fixed in Piwigo 14 <!-- github-comment-id:1850424179 -->
Author
Owner

Looks good to me. Thank you!

Looks good to me. Thank you! <!-- github-comment-id:1851081234 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1454