【发布时间】:2018-08-19 05:56:55
【问题描述】:
[我从本地主机运行脚本]
我正在尝试使用 Laravel 5.4 将文件上传到 AWS S3 存储桶,但出现此错误:
Error executing "PutObject" on "https://bucket_name.s3.amazonaws.com/1520719994357906.png"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
在文件系统.php 中:
's3' => [
'driver' => 's3',
'key' => 'KRY_HERE',
'secret' => 'SECRET_HERE',
'region' => 'us-east-1',
'bucket' => 'bucket_name', //has global access to read files
],
在控制器中:
Storage::disk('s3')->put($imageName, file_get_contents(public_path('galleries/').$imageName));
如何解决这个问题?如果我将应用程序上传到 EC2 实例,是否需要安装 SSL 才能将文件上传到 S3 存储桶?提前致谢。
【问题讨论】: