LoginSignup
0
0

More than 1 year has passed since last update.

Laravel6系をPHP8で動かす

Posted at

dockerで動かした時、STATUSがrestartingで正常に起動しない。

% docker-compose ps
NAME                                       COMMAND                  SERVICE                            STATUS              PORTS
〜
local-laravelproject-php-1                 "docker-php-entrypoi…"   laravelproject-php                 restarting
〜

logsで原因を探る。

% docker-compose logs
〜
local-laravelproject-php-1                | Installing dependencies from lock file (including require-dev)
local-laravelproject-php-1                | Verifying lock file contents can be installed on current platform.
local-laravelproject-php-1                | Your lock file does not contain a compatible set of packages. Please run composer update.
local-laravelproject-php-1                |
local-laravelproject-php-1                |   Problem 1
local-laravelproject-php-1                |     - facade/ignition-contracts is locked to version 1.0.1 and an update of this package was not requested.
local-laravelproject-php-1                |     - facade/ignition-contracts 1.0.1 requires php ^7.1 -> your php version (8.0.6) does not satisfy that requirement.
local-laravelproject-php-1                |   Problem 2
local-laravelproject-php-1                |     - facade/ignition-contracts 1.0.1 requires php ^7.1 -> your php version (8.0.6) does not satisfy that requirement.
local-laravelproject-php-1                |     - facade/ignition 1.18.0 requires facade/ignition-contracts ^1.0 -> satisfiable by facade/ignition-contracts[1.0.1].
local-laravelproject-php-1                |     - facade/ignition is locked to version 1.18.0 and an update of this package was not requested.

コンテナ起動時にcomposer installを実行するようにしているが、composerのfacade/ignition-contracts 1.0.1がPHP8で動作しないためにエラーで終了していた。composer updateでバージョンを上げてみる。

% docker-compose down
% docker-compose run laravelproject-php composer update facade/ignition-contracts
〜
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading facade/ignition-contracts (1.0.1 => 1.0.2)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Upgrading facade/ignition-contracts (1.0.1 => 1.0.2): Extracting archive
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
^[[B> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
62 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

改めて起動。STATUSがrunningで無事起動。

% docker-compose up -d
% docker-compose ps
NAME                                       COMMAND                  SERVICE                            STATUS              PORTS
〜
local-laravelproject-php-1                 "docker-php-entrypoi…"   laravelproject-php                 running             9000/tcp
〜
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0