磁盘[videos]没有配置的驱动程序

huangapple go评论70阅读模式
英文:

Disk

does not have a configured driver

问题

我正在尝试使用Laravel和FFmpeg创建缩略图,但遇到了这个错误。

磁盘

没有配置的驱动程序。

我的代码

public function index()
{
    FFMpeg::fromDisk('videos')
        ->open('steve_howe.mp4')
        ->getFrameFromSeconds(10)
        ->export()
        ->toDisk('thumnails')
        ->save('FrameAt10sec.png');
    // $videos =  Videos::where('user_email', Auth::user()->email)->get();
    // return view('instructor.videos')->with('videost', $videos);
}

可能的解决方案。谢谢

英文:

I am trying to create a thumbnail using laravel and ffmpeg. But am getting this error.

Disk

does not have a configured driver.

My code

public function index()
{
    FFMpeg::fromDisk('videos')
        ->open('steve_howe.mp4')
        ->getFrameFromSeconds(10)
        ->export()
        ->toDisk('thumnails')
        ->save('FrameAt10sec.png');
    // $videos =  Videos::where('user_email', Auth::user()->email)->get();
    //  return view('instructor.videos')->with('videost', $videos);
}

What could be the solution. Thanks

答案1

得分: 35

我尝试在Laravel 6上,显示如下: "InvalidArgumentException: Disk [public2] does not have a configured driver."。

我在config/filesystem.php上尝试过以下内容:

'public2' => [
'driver' => 'local',
'root' => storage_path('app'),
'url' => env('APP_URL') . '/public',
'visibility' => 'public',
],

然后尝试了:

composer dump-autoload -o

仍然显示异常错误。
请问我应该怎么做?
非常感谢

已解决

php artisan config:clear

英文:

i've tried on Laravel 6, it's shown : "InvalidArgumentException: Disk [public2] does not have a configured driver."

what I've tried on config/filesystem.php

    'public2' => [
    'driver' => 'local',
    'root' => storage_path('app'),
    'url' => env('APP_URL') . '/public',
    'visibility' => 'public',
],

then tried :

composer dump-autoload -o

still shown exception error.
May i know what I must todo ?
Thank you a lot

SOLVED

php artisan config:clear

答案2

得分: 22

打开您的配置文件 config/filesystems.php,并检查键 videos,确保它包含 'driver' => 'local' 或您想要使用的任何其他驱动程序。

示例:

'videos' => [
    'driver' => 'local',
    'root' => storage_path('videos'),
],
英文:

Open your config file config/filesystems.php and check the key videos, make sure it contains 'driver' => 'local' or any other driver that you are wanting to use.

Example

'videos' => [
    'driver' => 'local',
    'root' => storage_path('videos'),
],

答案3

得分: 4

我在尝试在Laravel作业中使用FFMpeg时遇到了相同的问题。

我通过使用以下方式解决了它:

php artisan queue:work
英文:

I had the same issue when trying to use FFMpeg in a Laravel Job.

I solved it by just restarting the queue using

php artisan queue:work

答案4

得分: 0

我完成了这个。Laravel 7。

return Storage::download('folder/file');
英文:

I did this. Laravel 7.

return Storage::download('folder/file');

答案5

得分: 0

这也可能发生在磁盘名称包含句点/点字符的情况下,例如foo.bar,这与框架在配置指令名称中实现点符号的方式有关。使用foo-bar将解决这个问题。

英文:

This can also occur if the disk name contains a period/full-stop character, for example, foo.bar, which has to do with how the framework implements dot-notation in configuration directive names. Using foo-bar will resolve the problem.

huangapple
  • 本文由 发表于 2020年1月6日 20:30:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/59612172.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定