Laravelでadjoint.phpがエラー

初めてnoteに書きますので、乱雑に書いてしまいます。読みにくさはご了承下さい。

Laravelでの開発で遭遇しましたが、以下のようなエラーがありました。

Warning: require(/var/www/ディレクトリ名/vendor/composer/../markbaker/matrix/classes/src/functions/adjoint.php): failed to open stream: No such file or directory in /var/www/ディレクトリ名/vendor/composer/autoload_real.php on line 61

Fatal error: require(): Failed opening required '/var/www/ディレクトリ名/vendor/composer/../markbaker/matrix/classes/src/functions/adjoint.php' (include_path='/var/www/ディレクトリ名/vendor/pear/pear_exception:/var/www/ディレクトリ名/vendor/pear/console_getopt:/var/www/ディレクトリ名/vendor/pear/pear-core-minimal/src:/var/www/ディレクトリ名/vendor/pear/archive_tar:.:/usr/share/php:/usr/share/pear') in /var/www/ディレクトリ名/vendor/composer/autoload_real.php on line 61

単純にautoload.phpで読み込めないファイルがあるということですが、
原因はLaravelのvendorディレクトリにある
markbaker/matrix
というパッケージが問題なのですが、


Notice the capitalized names are important in Linux based systems while in windows development environments the error may not occur!
Temporary solution:
A temporary fix is to rename folders "functions" to "Functions" as well as "operations" to "Operations" .
Path to those folders: markbaker > complex > matric > classes > src > operations OR functions

https://github.com/PrestaShop/PrestaShop/issues/15187#issuecomment-799016605

上記を見ると分かりますが、
・functions → Functions
・operations → Operations
とディレクトリ名の大文字小文字がエラー原因です。
gitも大文字小文字はデフォルトでは識別しない設定なので、この問題に遭遇しやすいのかもしれません(特にWindowsで開発、Linux環境で本番)。

$ git config core.ignorecase false
大文字小文字を区別する

としておくと良いのかもしれません。

始めてのテスト的な書き込みでした。
何か書き慣れないです。すみません。

この記事が気に入ったらサポートをしてみませんか?