e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

Internal server error when activating PHP 8.2 and trying to access the Plugin Manager in the Admin Area #4962

Closed Digioso closed 1 year ago

Digioso commented 1 year ago

Bug Description

In webserver log file: [Mon Jan 30 13:27:31.386317 2023] [proxy_fcgi:error] [pid 21877:tid 281472476770496] [client 88.130.87.199:0] AH01067: Failed to read FastCGI header, referer: https://www.baod.de/e107_admin/menus.php [Mon Jan 30 13:27:31.386372 2023] [proxy_fcgi:error] [pid 21877:tid 281472476770496] (104)Connection reset by peer: [client 88.130.87.199:0] AH01075: Error dispatching request to : , referer: https://www.baod.de/e107_admin/menus.php

How to Reproduce

Steps to reproduce the behavior:

  1. Activate PHP 8.2
  2. Access admin area
  3. Open Plugin Manager
  4. See error

Expected Behavior

No error

Server Information

PHP Operating System

Linux digioso.net 5.15.0-1027-oracle #33-Ubuntu SMP Fri Jan 6 16:30:16 UTC 2023 aarch64 
Ubuntu 22.04

PHP Version

PHP Version 8.2.1

PHP Modules

bcmath bz2 calendar cgi-fcgi Core ctype curl date dom exif FFI fileinfo filter ftp gd gettext hash iconv imagick imap intl json ldap libxml mbstring mysqli mysqlnd openssl pcre PDO pdo_mysql pdo_pgsql pgsql Phar posix pspell random readline Reflection session shmop SimpleXML soap sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip zlib

Client Information

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0

Additional Information

When I switch PHP back to PHP 7.4 the Plugin Manager is working without problems.

Deltik commented 1 year ago

I suspect you have encountered https://github.com/e107inc/e107/issues/4938, which is actually a low-level PHP bug (https://github.com/php/php-src/issues/10200).

We have a workaround from https://github.com/e107inc/e107/commit/6b75f341ad54bdc8c7333acecd0ca435a07b2086. Try applying this patch to see if it resolves your issue:

diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php
index 16adeb0f26..10a5d57f16 100644
--- a/e107_handlers/xml_class.php
+++ b/e107_handlers/xml_class.php
@@ -549,7 +549,7 @@ function xml2array($xml, $rec_parent = '')

        $ret = array();

-       $tags = get_object_vars($xml);
+       $tags = (array) $xml;

        //remove comments

I am forecasting that PHP 8.2.2 will fix https://github.com/php/php-src/issues/10200, so as an alternative, you could wait for that release.

PHP 8.1 is not affected, so that's yet another option.

Digioso commented 1 year ago

Thanks! I switched to PHP 8.1 for now and it's working again. :)