Solve the problem of “Please provide a valid cache path” in Laravel/Lumen
New project error:
//error:
InvalidArgumentException in Compiler.php line 36:
Please provide a valid cache path.
Error prompted by the error:
// vendor/illuminate/view/Compilers/Compiler.php
if (! $cachePath) {
throw new InvalidArgumentException('Please provide a valid cache path.');
}
This path is specified in config/cache.php and can be modified to other addresses by yourself:
// cache
return [
// ...
'stores' => [
// ...
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache'),
],
],
// ...
]
Create a directory:
✗ mkdir -p storage/framework/views
✗ mkdir -p storage/framework/cache
✗ mkdir -p storage/framework/sessions
Make sure the storage directory structure is as follows:
./storage
├── app
├── framework
│ ├── cache
│ ├── sessions
│ └── views
└── logs
└── lumen.log
Note that these directories must have read and write permissions.
Similar Posts:
- RuntimeError: Python is not installed as a framework [How to Solve]
- [How to Solve] gcc-4.7.2 cannot compute suffix of object fil…
- Django @csrf_exempt Cannot work in class view (Django @csrf_exempt not working in class View)
- [Solved] Runtime Warning: Font Glyph 20108 is missing. Font.set Fu text (s,0.0,flags=flags), RuntimeWarningGlyph20108missingfromcurrentfontfontsettexts00flagsflags
- After npm5, execute NPM cache clean and report an error
- Maven Project Error running ‘ [org.apache.maven.plugins:maven-archetype-plugin:RELEASE:generate]’: Cannot start process, the working directory ‘AppData\Local\Temp\archetypetmp’ does not exist
- Super detail: command not found: the scratch solution (add the scratch environment variable to Zsh under MAC)
- [Solved] Xcodebuild error: Command PhaseScriptExecution failed with a nonzero exit code
- You have not completed the merge: You have not concluded your merge (MERGE_HEAD exists)