1

Today i updated php in xampp to 8.1.0 after that all Laravel projects stopped in localhost.

So, after update composer.json from to

"php": "^7.3|^8.0",

I see the composer have problem like this after run composer update or any composer command:

PHP Deprecated:  Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/HelperSet.php on line 112

Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/HelperSet.php on line 112
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:48

How Can I solve this problem all my projects stopped because the composer have error.

Hasan Hatem
  • 55
  • 1
  • 2
  • 8
  • Why would it? Laravel 7 doesn't support PHP 8 and was written before it. – Jaquarh Dec 20 '21 at 18:06
  • 1
    Where did you see that Laravel 7 is compatible with PHP 8.1? – Brian Thompson Dec 20 '21 at 18:07
  • @Jaquarh so, what is the solution ? All laravel 7 projects must be updated to laravel 8? – Hasan Hatem Dec 20 '21 at 18:13
  • @BrianThompson so, what is the solution ? All laravel 7 projects must be updated to laravel 8? – Hasan Hatem Dec 20 '21 at 18:14
  • 1
    Well yes, if you want to use PHP 8 you need to use a compatible Laravel version. – Brian Thompson Dec 20 '21 at 18:17
  • 1
    @BrianThompson Laravel 7 (and 6) is still supported. The spec `^7.3|^8.0` means it works with 8.1. – miken32 Dec 20 '21 at 18:42
  • 5
    You need to update composer; the error messages clearly come from within `composer.phar`. Just do `composer selfupdate` – miken32 Dec 20 '21 at 18:42
  • @miken32 I see that that's true from the 6.X and 7.X branch in GitHub. I just checked the branch of the docs which I guess didn't get updated (just says `>=7.2.5`). Although now I've got to dig in further because I've seen several issues recently (myself and on SO) when using 8.1. But the [changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md#v8670-2021-10-22) shows it's been supported since October.. It's possible they have not been on the correct minor version. Usually you just get the major included in questions. – Brian Thompson Dec 20 '21 at 19:22
  • @miken32 `composer selfupdate` works perfectly for me. – Blues Clues Feb 17 '22 at 07:44

1 Answers1

2

I had the same issue with the newest xampp, all i did was go back to 7.4.26 and now the installations of 6-7 work fine.