解決 Laravel/Lumen 出現 "Please provide a valid cache path" 問題php
新建項目報錯:html
//錯誤提示: InvalidArgumentException in Compiler.php line 36: Please provide a valid cache path.
錯誤提示的出錯:sql
// vendor/illuminate/view/Compilers/Compiler.php if (! $cachePath) { throw new InvalidArgumentException('Please provide a valid cache path.'); }
這個路徑是在 config/cache.php 中指定的,能夠自行修改爲其餘地址:緩存
// cache 配置文件示例 return [ // ... 'stores' => [ // ... 'file' => [ 'driver' => 'file', 'path' => storage_path('framework/cache'), //緩存地址 ], ], // ... ]
建立目錄:session
✗ mkdir -p storage/framework/views ✗ mkdir -p storage/framework/cache ✗ mkdir -p storage/framework/sessions
確保 storage 目錄結構以下:app
./storage
├── app
├── framework
│ ├── cache │ ├── sessions │ └── views └── logs └── lumen.log
注意這些目錄要有讀寫權限.ide