8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【備忘録】storage/framework/cache のエラーでキャッシュを作り直した

Posted at

EC2インスタンスを再起動したら、こんなエラーが。

[oauth/token][exception_message]file_put_contents(/Hogehoge/storage/framework/cache/data/9a/c1/9ac1b29cf1a1d991418507a9743d8479c3be0636): failed to open stream: No such file or directory

どうやら再起動したとしても、内部のキャッシュが残っててしまって、更新したプログラムをうまく反映してくれない時があるらしいです・・・。
キャッシュ系を全部クリアしてみてみたり、不要になったファイルを削除してみたりしてもうまくいかず。
最終的に作り直しました。

$ composer dump-autoload // composer.json の名前空間の割り当てマップの変更を autoloader.php に反映させるコマンド
$ php artisan clear-compiled // クラスローディングの最適化や、テストのために最適化させるコマンド
$ php artisan optimize // 最適化されたクラスローダを生成するコマンド
$ php artisan config:cache // configのキャッシュをクリアするコマンド

参考
https://getcomposer.org/doc/03-cli.md#dump-autoload-dumpautoload-
http://recipes.laravel.jp/recipe/36
http://recipes.laravel.jp/recipe/50
https://qiita.com/Ping/items/10ada8d069e13d729701

8
8
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
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?