Quantcast
Channel: PHP8タグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 521

Laravel6をインストールした時に出たエラーを解決しました。

$
0
0
Laravel8が出ていますが、サポート期間が長く、情報も多い為、Laravel6で開発を進めようとしました。 そしたらこんなエラーが During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in/Applications/MAMP/htdocs/blog/vendor/laravel/framework/src/Illuminate/Support/Collection.php:1277 1単語ずつ翻訳していくと Illuminate\Support\Collection::offsetExists($key) のキーワードが引っかかったので、このキーワードで検索 エラーの原因はPHPのバージョンの違いによるエラー 私のパソコンではPHPのバージョンを確認したら PHP8.1 でした。 PHPのバージョンの確認方法 Terminal php -v PHPのバージョンを PHP7.4 にバージョンを下げたらLaravel6をインストールできました! バージョン変更手順 ついでにPHPのバージョンの変更(Mac)のやり方を書かせていただきます。 zshなら zsh vim ~/.zshrc bashなら bash vim ~/.bash_profile vimエディターが開かれる vim export PATH="/usr/local/opt/php@8.1/sbin:$PATH" export PATH="/usr/local/opt/php@8.1/bin:$PATH" 記述があったので@8.1を@7.4に変更 vim export PATH="/usr/local/opt/php@7.4/sbin:$PATH" export PATH="/usr/local/opt/php@7.4/bin:$PATH" 最後にPHPのバージョン確認 Terminal php -v これで php7.4 に変更されていればバージョンの変更完了

Viewing all articles
Browse latest Browse all 521

Trending Articles