Laravel10にバージョンアップして、ローカルでのテストを終えてCORESERVER(コアサーバー)
にデプロイしたところInternal Server Error 500で動かない。ログは出力されないし中途半端に動く。調査していったらログを出力するコードで落ちることが判明した。
PHP拡張機能のPSRをオフにすることで解決しました。
ローカル環境はSailをベースに作っているのですが、PSR拡張はインストールしていませんでした。

以下を参考にしました。
Laravel 10.x / PHP 8.2.x / PHP Fatal error: Declaration of Monolog ? #46165
Can’t use the Logger and it breaks capturing Exceptions, displays a 500 error
This occurs when an exception is thrown. Because it throws a 500 and not the lovely laravel debugger screen, I only was able to catch this in sentry.
It’s been happening when any error is thrown.
https://packagist.org/packages/monolog/monolog
https://packagist.org/packages/psr/logSeems the issue is in psr/log.
Tested with APP_DEBUG=false and no maintenance page is displayed just the 500 error.
So can’t use the framework in production on a live system
https://github.com/laravel/framework/issues/46165#issuecomment-1435732003
Hey @driesvints,
The unofficial PSR extension available in PECL ships old PSR versions, and thus conflicts with many libraries.
https://github.com/laravel/framework/issues/46165#issuecomment-1436189552
コメント