Composer could not detect the root package (laravel/laravel) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
php-http/discovery contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "php-http/discovery" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
kylekatarnls/update-helper contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "kylekatarnls/update-helper" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
illuminate/contracts[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.2.18) does not satisfy that requirement.
illuminate/contracts[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.2.18) does not satisfy that requirement.
illuminate/contracts[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.2.18) does not satisfy that requirement.
illuminate/contracts[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.2.18) does not satisfy that requirement.
You can only install one version of a package, so only one of these can be installed: psr/simple-cache[1.0.0, 1.0.1, 2.0.0, 2.x-dev, 3.0.0, 3.0.x-dev].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
webアクセス時のlaravel.log
[2024-04-11 13:42:59] local.ERROR: Target class [Fruitcake\Cors\HandleCors] does not exist. {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target class [Fruitcake\Cors\HandleCors] does not exist. at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:914)
[stacktrace]
[previous exception] [object] (ReflectionException(code: -1): Class \"Fruitcake\Cors\HandleCors\" does not exist at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:912)
[stacktrace]
"}
[2024-04-11 13:42:59] local.ERROR: Target class [Fruitcake\Cors\HandleCors] does not exist. {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target class [Fruitcake\Cors\HandleCors] does not exist. at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:914)
[stacktrace]
[previous exception] [object] (ReflectionException(code: -1): Class \"Fruitcake\Cors\HandleCors\" does not exist at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:912)
[stacktrace]
Describe the bug / バグの説明
v5.0.11 から「更新手順 v6.0.0」に従いUpdateを進めていましたが、途中でエラーになりました。
エラーが出たのは次の2点でそれぞれ以下の対応を行いました。この対応であってますでしょうか?
対応
app/Http/Kernel.php 修正
composer updateのログ1
Composer could not detect the root package (laravel/laravel) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version php-http/discovery contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins Do you trust "php-http/discovery" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y kylekatarnls/update-helper contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins Do you trust "kylekatarnls/update-helper" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.
Problem 1
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
webアクセス時のlaravel.log
[2024-04-11 13:42:59] local.ERROR: Target class [Fruitcake\Cors\HandleCors] does not exist. {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target class [Fruitcake\Cors\HandleCors] does not exist. at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:914) [stacktrace]
0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()
1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()
2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()
3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()
4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(172): Illuminate\Foundation\Application->make()
5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
6 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\TrustProxies->handle()
7 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
8 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then()
9 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
10 /var/www/exment/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle()
11 {main}
[previous exception] [object] (ReflectionException(code: -1): Class \"Fruitcake\Cors\HandleCors\" does not exist at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:912) [stacktrace]
0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(912): ReflectionClass->__construct()
1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()
2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()
3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()
4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()
5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(172): Illuminate\Foundation\Application->make()
6 /var/www/exment/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
7 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\TrustProxies->handle()
8 /var/www/exment/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
9 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then()
10 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
11 /var/www/exment/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle()
12 {main}
"} [2024-04-11 13:42:59] local.ERROR: Target class [Fruitcake\Cors\HandleCors] does not exist. {"exception":"[object] (Illuminate\Contracts\Container\BindingResolutionException(code: 0): Target class [Fruitcake\Cors\HandleCors] does not exist. at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:914) [stacktrace]
0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()
1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()
2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()
3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()
4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(255): Illuminate\Foundation\Application->make()
5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\Foundation\Http\Kernel->terminateMiddleware()
6 /var/www/exment/public/index.php(55): Illuminate\Foundation\Http\Kernel->terminate()
7 {main}
[previous exception] [object] (ReflectionException(code: -1): Class \"Fruitcake\Cors\HandleCors\" does not exist at /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php:912) [stacktrace]
0 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(912): ReflectionClass->__construct()
1 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()
2 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(957): Illuminate\Container\Container->resolve()
3 /var/www/exment/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()
4 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(942): Illuminate\Container\Container->make()
5 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(255): Illuminate\Foundation\Application->make()
6 /var/www/exment/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\Foundation\Http\Kernel->terminateMiddleware()
7 /var/www/exment/public/index.php(55): Illuminate\Foundation\Http\Kernel->terminate()
8 {main}
"}
Additional context / その他
参考にしたページ https://www.bit-hive.com/articles/20230329