use*_*908 122 laravel laravel-5.2
我复制了一个工作的laravel应用程序并将其重命名为另一个应用程序.我删除了vendor文件夹并再次运行以下命令:
composer self-update
composer-update
npm install
bower install
Run Code Online (Sandbox Code Playgroud)
我正确配置了我的路线和一切但是现在当我尝试在浏览器中运行我的应用程序时,我收到以下错误:
Compiler.php第36行中的InvalidArgumentException:请提供有效的缓存路径.
Filesystem.php第111行中的ErrorException:file_put_contents(F:\ www\example\app\storage\framework/sessions/edf262ee7a2084a923bb967b938f54cb19f6b37d):无法打开流:没有此类文件或目录
我以前从来没有遇到过这个问题,我不知道是什么导致它我也不知道如何修复它,我已经在网上搜索解决方案,但到目前为止还没有找到.
Mau*_*ins 414
试试吧:
在storage/framework下创建这些文件夹:
sessionsviewscache现在它的工作!
the*_*len 38
试试这个:
php artisan cache:clearphp artisan config:clearphp artisan view:clearuse*_*966 26
确保存储目录中的以下文件夹:
下面是一个为你做的命令行片段
cd storage
mkdir logs
mkdir framework
mkdir framework/cache && framework/cache/data
mkdir framework/sessions
mkdir framework/testing
mkdir framework/views
chgrp -R www-data ../storage
chown -R www-data ../storage
Run Code Online (Sandbox Code Playgroud)
Soh*_*med 20
您需要在“框架”内创建文件夹。请按照以下步骤操作:
cd storage/
mkdir -p framework/{sessions,views,cache}
Run Code Online (Sandbox Code Playgroud)
您还需要设置权限以允许 Laravel 在此目录中写入数据。
chmod -R 775 framework
chown -R www-data:www-data framework
Run Code Online (Sandbox Code Playgroud)
Whi*_*bit 19
我的2分钱
删除存储中的所有内容,然后执行以下操作:
> cd storage/
> mkdir -p framework/{sessions,views,cache}
> chmod -R 755 framework
// This last line depends on your user group settings so
// it may not be applicable to you.
> chown -R www-data:www-data framework
Run Code Online (Sandbox Code Playgroud)
为我工作=)
小智 16
您可以编辑readme.md,并在其他环境中安装laravel应用程序,如下所示:
## Create folders
```
#!terminal
cp .env.example .env && mkdir bootstrap/cache storage storage/framework && cd storage/framework && mkdir sessions views cache
```
## Folder permissions
```
#!terminal
sudo chown :www-data app storage bootstrap -R
sudo chmod 775 app storage bootstrap -R
```
## Install dependencies
```
#!terminal
composer install
```
Run Code Online (Sandbox Code Playgroud)
小智 13
可以从Illuminate\View\Compilers\Compiler.php中找到此错误的原因
public function __construct(Filesystem $files, $cachePath)
{
if (! $cachePath) {
throw new InvalidArgumentException('Please provide a valid cache path.');
}
$this->files = $files;
$this->cachePath = $cachePath;
}
Run Code Online (Sandbox Code Playgroud)
BladeCompiler在Illuminate\View\ViewServiceProvider中调用构造函数
/**
* Register the Blade engine implementation.
*
* @param \Illuminate\View\Engines\EngineResolver $resolver
* @return void
*/
public function registerBladeEngine($resolver)
{
// The Compiler engine requires an instance of the CompilerInterface, which in
// this case will be the Blade compiler, so we'll first create the compiler
// instance to pass into the engine so it can compile the views properly.
$this->app->singleton('blade.compiler', function () {
return new BladeCompiler(
$this->app['files'], $this->app['config']['view.compiled']
);
});
$resolver->register('blade', function () {
return new CompilerEngine($this->app['blade.compiler']);
});
}
Run Code Online (Sandbox Code Playgroud)
因此,进一步追溯,以下代码:
$this->app['config']['view.compiled']
Run Code Online (Sandbox Code Playgroud)
如果使用标准的laravel结构,通常位于/config/view.php中.
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => realpath(storage_path('framework/views')),
];
Run Code Online (Sandbox Code Playgroud)
如果路径不存在,则realpath(...)返回false.因此,调用
'Please provide a valid cache path.' error.
Run Code Online (Sandbox Code Playgroud)
因此,要摆脱这个错误,你可以做的就是确保这一点
storage_path('framework/views')
Run Code Online (Sandbox Code Playgroud)
要么
/storage/framework/views
Run Code Online (Sandbox Code Playgroud)
存在:)
Moh*_*nas 13
请尝试以下操作:
在存储/框架下创建这些文件夹:
如果仍然不起作用,请尝试
php artisan cache:clear
php artisan config:clear
php artisan view:clear
Run Code Online (Sandbox Code Playgroud)
如果出现无法清除缓存的错误。确保在缓存/数据中创建文件夹数据
Ran*_*dia 12
运行这些命令来创建所需的目录:
cd storage/
mkdir -p framework/{sessions,views,cache}
chmod -R 777 framework
Run Code Online (Sandbox Code Playgroud)
就是这样!
Ndi*_*ong 12
php artisan cache:clear
php artisan config:clear
php artisan view:clear
Run Code Online (Sandbox Code Playgroud)
logs
framework
framework/cache
framework/sessions
framework/views
Run Code Online (Sandbox Code Playgroud)
config/view.php存在。如果没有,您可以为您正在使用的 Laravel 获取此文件的副本,并将其复制到项目配置文件夹中。小智 8
当我在存储文件夹及其子文件夹session、views和cache 中创建框架文件夹时,我解决了这个问题。
转到您的 cmd 或终端,然后输入您的项目根路径,然后输入以下内容:
cd storage
mkdir framework
cd framework
mkdir sessions
mkdir views
mkdir cache
Run Code Online (Sandbox Code Playgroud)
再次转到您的项目根路径并运行composer update
在那之后,工匠完美地工作。
小智 7
步骤1\xe3\x80\x81创建这些文件夹
\n步骤2\xe3\x80\x81清除缓存/配置/视图
\n小智 6
请在终端运行,
sudo mkdir storage/framework
sudo mkdir storage/framework/sessions
sudo mkdir storage/framework/views
sudo mkdir storage/framework/cache
sudo mkdir storage/framework/cache/data
Run Code Online (Sandbox Code Playgroud)
现在您必须更改权限,
sudo chmod -R 777 storage
Run Code Online (Sandbox Code Playgroud)
步骤1:php artisan storage:link
步骤 2:在存储文件夹中创建这些文件夹
确保存储目录中有以下文件夹:
logs
framework
framework/cache
framework/sessions
framework/views
Run Code Online (Sandbox Code Playgroud)
这对我有用
| 归档时间: |
|
| 查看次数: |
120730 次 |
| 最近记录: |