27
13

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.

ComposerでPlease provide a valid cache pathとなったときの対応方法

Last updated at Posted at 2019-08-06
  • 環境
    • Windows10 bit64
    • Laravel Framework 5.5.40
    • PHP 7.3.7 (cli)

事象 : composerでインストールしたら何かお願いされた

$ composer install
#... 省略 ...
In Compiler.php line 36:

  Please provide a valid cache path.


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

原因 : strage/frameworkディレクトリ配下にstorage_pathで設定されているディレクトリがないから

$ find storage/framework/ -type d
storage/framework/
storage/framework/aop
storage/framework/aop/compile

対応 : 設定されているディレクトリを作成する

# configディレクトリからstorage_pathで設定している値を確認して
$ find config/ -type f | xargs grep storage_path | grep framework
config/cache.php:            'path' => storage_path('framework/cache/data'),
config/iwrsAspect.php:                'compile_dir' => storage_path('framework/aop/compile'),
config/iwrsAspect.php:                'cache_dir' => storage_path('framework/aop/cache'),
config/session.php:    'files' => storage_path('framework/sessions'),
config/view.php:    'compiled' => realpath(storage_path('framework/views')),

# ないディレクトリを作成する
$ mkdir -p storage/framework/cache/data/
$ mkdir -p storage/framework/aop/cache
$ mkdir -p storage/framework/sessions
$ mkdir -p storage/framework/views
27
13
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
27
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?