LoginSignup
6
2

More than 3 years have passed since last update.

PHP8にアップデートしたら、laravelでMethod ReflectionParameter::getClass() is deprecated in ... エラーが出た話

Posted at

使用していたバージョン

Laravel Framework 7.30.1
PHP 8.0.0

エラー発生時

laravelでいつものようにphp artisan コマンドを使ったが、

Method ReflectionParameter::getClass() is deprecated in ...

長ったらしい文が出てきて、コマンドが使えない。

参考サイトによるとphp8で推奨されていないらしい、、、。

解決方法

  • composer.jsonファイルのphpのバージョンを変更 例えば
php:^7.2.5  =>  php:^8.0
  • コマンドでcomposer updateを実行 で解決します。

** また、バージョン変更により本番環境でがシステムが動かなくなる可能性があるので、
念のため

php:^7.2.5  =>  php:^8.0
ではなく

php:^7.2.5|^8.0

上記のように書き換えるといいです。

参考サイト

6
2
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
6
2