【问题标题】:Digital Ocean spaces not working in the remote environment - Laravel 5.5数字海洋空间在远程环境中不起作用 - Laravel 5.5
【发布时间】:2017-09-29 08:46:59
【问题描述】:

我使用this 教程定义驱动程序并连接到我在 Digital Ocean 上的空间。

在我的config\filesystems.php 我有这个代码:

'spaces' => [
    'driver' => 'spaces',
    'version' => '2006-03-01',
    'key' => env('DO_SPACES_KEY'),
    'secret' => env('DO_SPACES_SECRET'),
    'endpoint' => env('DO_SPACES_ENDPOINT'),
    'region' => env('DO_SPACES_REGION'),
    'bucket' => env('DO_SPACES_BUCKET'),
    'bucket_name' => env('DO_SPACES_BUCKET'),
],

在我的一个控制器中我有这个代码:

$client->subdomain = 'acme';

$directories_client = Storage::disk('spaces')->directories('clients/'.$client->subdomain);

问题

spaces 驱动程序的连接在我的本地环境中完美运行。 但是,在远程环境中,这条线

$directories_client = Storage::disk('spaces')->directories('clients/'.$client->subdomain);

产生错误。这是我的日志上写的帽子:

[2017-09-29 07:19:08] remote.ERROR: Driver [] is not supported. 
{"userId":5,"email":"_________","exception":"[object] 
(InvalidArgumentException(code: 0): Driver [] is not supported. at 



/.../src/Illuminate/ Filesystem/FilesystemManager.php:124)

本地代码在远程失败的同时完美运行。

有什么想法吗?

彼得

【问题讨论】:

    标签: php laravel filesystems digital-ocean laravel-5.5


    【解决方案1】:

    您需要使用s3 作为驱动程序名称,只需更改此名称 'driver' => 'spaces','driver' => 's3',

    【讨论】:

    • 一个s3 驱动数字海洋服务?
    • 是的,digitalocean 空间创建了与 s3 相同的 api,因此您可以使用 s3 驱动程序
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-02
    • 2015-03-14
    • 2017-12-03
    • 2021-10-24
    • 2020-12-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多