1、2018/05/14 17:59:01 [error] 7932#0: *3 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught UnexpectedValueException: The stream or file "xxx/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in xxx/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:107
解決:設置權限
$ chmod -R 777 storage/
2、 Laravel/Lumen 出現 "Please provide a valid cache path" 問題
//錯誤提示:
InvalidArgumentException in Compiler.php line 36:
Please provide a valid cache path.
解決:
這個路徑是在 config/cache.php 中指定的,可以自行修改成其他地址:
// cache 配置文件示例
return [
// ...
'stores' => [
// ...
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache'), //緩存地址
],
],
// ...
]
創建目錄:
✗ mkdir -p storage/framework/views
✗ mkdir -p storage/framework/cache
✗ mkdir -p storage/framework/sessions
確保 storage 目錄結構如下:
./storage
├── app
├── framework
│ ├── cache
│ ├── sessions
│ └── views
└── logs
└── lumen.log
注意這些目錄要有讀寫權限.