cachet icon indicating copy to clipboard operation
cachet copied to clipboard

PHP 8.1 compatible

Open AnnAngela opened this issue 4 years ago • 2 comments

When I tried to install Cachet with PHP 8.1, there was an error throwed and the installation had been stopped:

shell output
root@annangela:/var/www/Cachet# php artisan app:install
PHP Fatal error:  During inheritance of IteratorAggregate: Uncaught ErrorException: Return type of Symfony\Component\HttpFoundation\ParameterBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/Cachet/vendor/symfony/http-foundation/ParameterBag.php:224
Stack trace:
#0 /var/www/Cachet/vendor/symfony/http-foundation/ParameterBag.php(19): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/Cachet/vendor/composer/ClassLoader.php(571): include('...')
#2 /var/www/Cachet/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#3 /var/www/Cachet/vendor/symfony/http-foundation/Request.php(240): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/Cachet/vendor/symfony/http-foundation/Request.php(222): Symfony\Component\HttpFoundation\Request->initialize()
#5 /var/www/Cachet/vendor/symfony/http-foundation/Request.php(1913): Symfony\Component\HttpFoundation\Request->__construct()
#6 /var/www/Cachet/vendor/symfony/http-foundation/Request.php(398): Symfony\Component\HttpFoundation\Request::createRequestFromFactory()
#7 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php(20): Symfony\Component\HttpFoundation\Request::create()
#8 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\SetRequestForConsole->bootstrap()
#9 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(219): Illuminate\Foundation\Application->bootstrapWith()
#10 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(105): Illuminate\Foundation\Console\Kernel->bootstrap()
#11 /var/www/Cachet/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#12 {main} in /var/www/Cachet/vendor/symfony/http-foundation/ParameterBag.php on line 19
PHP Fatal error:  Uncaught ErrorException: Method ReflectionParameter::getClass() is deprecated in /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php:794
Stack trace:
#0 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php(794): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php(774): Illuminate\Container\Container->getDependencies()
#2 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build()
#3 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make()
#4 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php(230): Illuminate\Foundation\Application->make()
#5 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Container\Container->Illuminate\Container\{closure}()
#6 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build()
#7 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make()
#8 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(154): Illuminate\Foundation\Application->make()
#9 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(79): Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler()
#10 /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(118): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException()
#11 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#12 {main}
  thrown in /var/www/Cachet/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 794

And after googling the keyword ReturnTypeWillChange of the output, I found out an issue from phpmyadmin/phpmyadmin#16746 and I believed the problem is the incompatible between Cachet and PHP 8.1. Please help to fix it!

Reference: The Backward Incompatible Changes Chapter in PHP 8.1 migration guide

AnnAngela avatar Jan 23 '22 14:01 AnnAngela

:wave: Thank you for opening your first issue. I'm just an automated bot that's here to help you get the information you need quicker, so please ignore this message if it doesn't apply to your issue. If you're looking for support, you should try the Slack group by registering your email address at https://cachethq-slack.herokuapp.com. Alternatively, email [email protected] for our Professional support service (please note, this a paid service.) If you're issue is with documentation, you can suggest edits by clicking the Suggest Edits link on any page, or open an issue at https://github.com/CachetHQ/Docs

welcome[bot] avatar Jan 23 '22 14:01 welcome[bot]

Hi @AnnAngela I think this can be fixed by updating the composer.lock file of this repo or bumping a version in https://github.com/CachetHQ/Cachet/blob/2.4/composer.json

williamdes avatar Feb 20 '22 16:02 williamdes

Thank you for your input on Cachet 2.x. We are shifting our attention and resources to Cachet 3.x and will no longer be supporting the 2.x version. If your feedback or issue is relevant to the 3.x series, we encourage you to engage with the new branch.

For more information on the Cachet rebuild and our plans for 3.x, you can read the announcement here.

We appreciate your understanding and look forward to your contributions to the new version.

jbrooksuk avatar Aug 12 '23 19:08 jbrooksuk