cydrobolt / polr

:aerial_tramway: A modern, powerful, and robust URL shortener
https://polrproject.org
GNU General Public License v2.0
5k stars 888 forks source link

Polr fails to render in php8 due to fatal error #639

Open fleish opened 10 months ago

fleish commented 10 months ago

Expected Behavior

Polr code should render and pages should load

Current Behavior

Polr code fails due to PHP fatal error

Steps to Reproduce (for bugs)

  1. Upgrade from php7.4 (PHP Version 7.4.3-4ubuntu2.19) to php8.3 (PHP Version 8.3.2-1+ubuntu20.04.1+deb.sury.org+1)
  2. Attempt to load polr in web browser
  3. Observe php fatal error in logs and page does not render

From trying to load /:

Stack trace:
#0 /var/www/html/polr/vendor/illuminate/config/Repository.php(9): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#1 /var/www/html/polr/vendor/composer/ClassLoader.php(444): include('...')
#2 /var/www/html/polr/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/html/polr/vendor/laravel/lumen-framework/src/Application.php(524): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/polr/vendor/illuminate/container/Container.php(738): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#5 /var/www/html/polr/vendor/illuminate/container/Container.php(631): Illu...; PHP message: PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Http\Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/polr/vendor/illuminate/http/Request.php:850
Stack trace:
#0 /var/www/html/polr/vendor/illuminate/http/Request.php(14): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#1 /var/www/html/polr/vendor/composer/ClassLoader.php(444): include('...')
#2 /var/www/html/polr/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/html/polr/vendor/laravel/lumen-framework/src/Application.php(712): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/polr/vendor/illuminate/container/Container.php(738): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#5 /var/www/html/polr/vendor/illu
2024/01/21 21:34:20 [error] 24186#24186: *20 FastCGI sent in stderr: "PHP message: PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Config\Repository::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/polr/vendor/illuminate/config/Repository.php:118
Stack trace:
#0 /var/www/html/polr/vendor/illuminate/config/Repository.php(9): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#1 /var/www/html/polr/vendor/composer/ClassLoader.php(444): include('...')
#2 /var/www/html/polr/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/html/polr/vendor/laravel/lumen-framework/src/Application.php(524): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/polr/vendor/illuminate/container/Container.php(738): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#5 /var/www/html/polr/vendor/illuminate/container/Container.php(631): Illu...; PHP message: PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Http\Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/polr/vendor/illuminate/http/Request.php:850
Stack trace:
#0 /var/www/html/polr/vendor/illuminate/http/Request.php(14): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#1 /var/www/html/polr/vendor/composer/ClassLoader.php(444): include('...')
#2 /var/www/html/polr/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/html/polr/vendor/laravel/lumen-framework/src/Application.php(712): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/polr/vendor/illuminate/container/Container.php(738): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#5 /var/www/html/polr/vendor/illu

From trying to load /login

2024/01/21 21:34:24 [error] 24186#24186: *20 FastCGI sent in stderr: "PHP message: PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Config\Repository::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/polr/vendor/illuminate/config/Repository.php:118
Stack trace:
#0 /var/www/html/polr/vendor/illuminate/config/Repository.php(9): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#1 /var/www/html/polr/vendor/composer/ClassLoader.php(444): include('...')
#2 /var/www/html/polr/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/html/polr/vendor/laravel/lumen-framework/src/Application.php(524): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/polr/vendor/illuminate/container/Container.php(738): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#5 /var/www/html/polr/vendor/illuminate/container/Container.php(631): Illu...; PHP message: PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Http\Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/polr/vendor/illuminate/http/Request.php:850
Stack trace:
#0 /var/www/html/polr/vendor/illuminate/http/Request.php(14): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#1 /var/www/html/polr/vendor/composer/ClassLoader.php(444): include('...')
#2 /var/www/html/polr/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile()
#3 /var/www/html/polr/vendor/laravel/lumen-framework/src/Application.php(712): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/html/polr/vendor/illuminate/container/Container.php(738): Laravel\Lumen\Application->Laravel\Lumen\{closure}()
#5 /var/www/html/polr/vendor/illu

Context

Trying to keep system code up to date

Your Environment

fleish commented 5 months ago

@cydrobolt any chance you could take a look at this? I just got bit by it again when I blindly ran an apt autoremove which pulled the php7.4 packages in favor of php8.3. I restored php7.4 to fix, but since that's been EOL since November 2022 it would be great to be able to upgrade and still have polr be functional. Thanks in advance.

redlukas commented 3 months ago

running into the same issues, compatibility with PHP > 8 would be greatly appreciated