【发布时间】:2020-12-17 11:06:21
【问题描述】:
我弄乱了让 UniSharp / laravel-filemanager 在服务器上工作的路径。在本地模式下它工作得很好,但现在我正在改变在线模式下的生产路线,我一点都不清楚。
问题在于它加载了图像,但它们既没有显示在页面上,也没有显示在文件管理器本身中。在文件管理器中,我可以看到一个带有十字的红色方块(作为错误)。 让我们看看是否有人知道如何编写正确的路线。我尝试了很多东西,但我一团糟。
服务器文件脚手架:
- server_files
- my_laravel_app
- public_html
- 另一个文件
Laravel 中的配置文件system.php 文件:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('public_html'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
],
'links' => [
public_path('storage') => storage_path('app/public'),
],
我有,filemanager的lfm.php默认上传路径:
'disk' => 'public',
如果它有帮助,这是我在 public_html 上的 index.php:
if (file_exists(__DIR__.'/../my_app_laravel/storage/framework/maintenance.php')) {
require __DIR__.'/../my_app_laravel/storage/framework/maintenance.php';
}
require __DIR__.'/../my_app_laravel/vendor/autoload.php';
$app = require_once __DIR__.'/../my_app_laravel/bootstrap/app.php';
这是 ServiceProviders.php
public function register()
{
$this->app->bind('path.public', function() {
return base_path().'/public_html';
});
}
文件系统中的正确路径应该如何让文件管理器可以访问图像并显示它们?
注意:public_html 文件夹有符号链接,您可以在 filesystem.php 中看到。
【问题讨论】: