PHP-7.4 Issue = "Trying to access array offset on value of type null" in functions_category.inc.php #986

Closed
opened 2026-10-05 00:26:43 +02:00 by adam · 10 comments
Owner

After upgrading from php-7.3.12 to php-7.4.0 I'm now seeing an error logged on the very front page:

[Notice: Trying to access array offset on value of type null in
/var/www/piwigo.reub.net/htdocs/include/functions_category.inc.php
on line 125]

It looks like some tweaking may be required for the newer version of php. This error does not occur with php-7.3 .

This is on a Gentoo x86_64 box with apache 2.4.41 as the web server.

After upgrading from php-7.3.12 to php-7.4.0 I'm now seeing an error logged on the very front page: [Notice: Trying to access array offset on value of type null in /var/www/piwigo.reub.net/htdocs/include/functions_category.inc.php on line 125] It looks like some tweaking may be required for the newer version of php. This error does not occur with php-7.3 . This is on a Gentoo x86_64 box with apache 2.4.41 as the web server. <!-- github-sync-id:531070764 -->
adam closed this issue 2026-10-05 00:26:43 +02:00
Author
Owner

Also happens on Arch, with PHP 7.4.1

Also happens on Arch, with PHP 7.4.1 <!-- github-comment-id:567620672 -->
Author
Owner

Happens on Ubuntu server and PHP 7.4.1 as well.

Happens on Ubuntu server and PHP 7.4.1 as well. <!-- github-comment-id:569454863 -->
Author
Owner

I just installed Piwigo and used the current versions of all components.
This happens also on a Win7/Win10 System and according to the links bellow is related to PHP 7.4.
The function itself seems not be affected. I just receive a lot of warnings at the start page which looks awful.

Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.4.1
Databse-Client Version: libmysql - mysqlnd 7.4.1
PHP-Extension: mysqliDokumentation curlDokumentation mbstringDokumentation
PHP-Version: 7.4.1

Fix issues regarding accessing null/bool/etc
PHP RFC: E_WARNING for invalid container read array-access

I just installed Piwigo and used the current versions of all components. This happens also on a Win7/Win10 System and according to the links bellow is related to PHP 7.4. The function itself seems not be affected. I just receive a lot of warnings at the start page which looks awful. > Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.4.1 > Databse-Client Version: libmysql - mysqlnd 7.4.1 > PHP-Extension: mysqliDokumentation curlDokumentation mbstringDokumentation > PHP-Version: 7.4.1 [Fix issues regarding accessing null/bool/etc](https://core.trac.wordpress.org/ticket/47704) [PHP RFC: E_WARNING for invalid container read array-access](https://wiki.php.net/rfc/notice-for-non-valid-array-container) <!-- github-comment-id:570920520 -->
Author
Owner

Proposed a fix #1147

Proposed a fix #1147 <!-- github-comment-id:576026923 -->
Author
Owner

Proposed a fix #1147

Confirmed - this fix works for me. Applies cleanly and resolves the nasty warning.

> Proposed a fix #1147 Confirmed - this fix works for me. Applies cleanly and resolves the nasty warning. <!-- github-comment-id:576052928 -->
Author
Owner

Same here. No more warnings, thanks. :)

Same here. No more warnings, thanks. :) <!-- github-comment-id:576390219 -->
Author
Owner

Proposed a fix #1147

Can confirm, this fix works for me too under PHP 7.4.2
Thank you

> Proposed a fix #1147 Can confirm, this fix works for me too under PHP 7.4.2 Thank you <!-- github-comment-id:582518521 -->
Author
Owner

#1147 merged

#1147 merged <!-- github-comment-id:583394824 -->
Author
Owner

Fixed on master cade53577c and cherry-picked on 2.10 (for Piwigo 2.10.2) f78b10d1be

Thank you @ewft for the fix and other users for confirming it worked fine on your environment :-)

Fixed on master cade53577ce3b73b0903643f45232ae0c54428b5 and cherry-picked on 2.10 (for Piwigo 2.10.2) f78b10d1beebabc3335bdf5ad8bfa4b9e484a2aa Thank you @ewft for the fix and other users for confirming it worked fine on your environment :-) <!-- github-comment-id:583405409 -->
Author
Owner

The problem was solved by downgrading php from 7.4 to 7.3

.. though I haven't checked do I have the newest piwigo (just migrated the site to different host and have to sort out ssl before being able log into the admin panel)

gallery.lvchamber.uk

The problem was solved by downgrading php from 7.4 to 7.3 .. though I haven't checked do I have the newest piwigo (just migrated the site to different host and have to sort out ssl before being able log into the admin panel) gallery.lvchamber.uk <!-- github-comment-id:585599806 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#986