新建项目报错:

  1. //错误提示:
  2. InvalidArgumentException in Compiler.php line 36:
  3. Please provide a valid cache path.

错误提示的出错:

  1. // vendor/illuminate/view/Compilers/Compiler.php
  2. if (! $cachePath) {
  3. throw new InvalidArgumentException('Please provide a valid cache path.');
  4. }

这个路径是在 config/cache.php 中指定的,可以自行修改成其他地址:

  1. // cache 配置文件示例
  2. return [
  3. // ...
  4. 'stores' => [
  5. // ...
  6. 'file' => [
  7. 'driver' => 'file',
  8. 'path' => storage_path('framework/cache'), //缓存地址
  9. ],
  10. ],
  11. // ...
  12. ]

创建目录:

  1. mkdir -p storage/framework/views
  2. mkdir -p storage/framework/cache
  3. mkdir -p storage/framework/sessions

确保 storage 目录结构如下:

  1. ./storage
  2. ├── app
  3. ├── framework
  4. ├── cache
  5. ├── sessions
  6. └── views
  7. └── logs
  8. └── lumen.log

注意这些目录要有读写权限.

分类: web

标签:   laravel   php