【发布时间】:2021-01-18 01:58:25
【问题描述】:
在 Laravel 8 上
file_get_contents(asset('storage/list.json');
给我:
错误异常 file_get_contents(http://localhost:8000/storage/list.json): 失败 打开流:HTTP 请求失败!
但是:http://localhost:8000/storage/list.json 存在,例如可以通过浏览器访问。
在我的config/filesystem.phpiv'e:
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'permissions' => [
'file' => [
'public' => 0664,
'private' => 0600,
],
'dir' => [
'public' => 0775,
'private' => 0700,
],
],
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
我创建了符号链接:
php artisan storage:link
命令。
我什至尝试按照 filesystem.php 中的描述手动将文件持久性添加到存储文件夹,但没有任何改变。
【问题讨论】:
标签: laravel permissions storage file-permissions