Amazon S3上传错误SSL证书问题 [英] Amazon S3 Upload error SSL certificate issues
问题描述
我正在尝试在本地主机上测试Laravel Amazon S3,但始终收到相同的错误:
I'm trying to test Laravel Amazon S3 on my localhost but keep getting the same error:
WrappedHttpHandler.php第192行中的S3Exception:执行错误 "ListObjects"上 " https://s3-us-west-2.amazonaws.com/app?prefix=appimages%2FIMG-1469840859-j.jpg%2F&max-keys=1&encoding-type=url ; AWS HTTP错误:cURL错误60:SSL证书问题:无法获取 当地发行人证书(请参阅 http://curl.haxx.se/libcurl/c/libcurl-errors.html )
S3Exception in WrappedHttpHandler.php line 192: Error executing "ListObjects" on "https://s3-us-west-2.amazonaws.com/app?prefix=appimages%2FIMG-1469840859-j.jpg%2F&max-keys=1&encoding-type=url"; 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)
我的代码:
$s3 = \Storage::disk('s3');
$filePath = '/images/' . $filename;
$s3->put($filePath, file_get_contents($image), 'public');
推荐答案
您已经对php.ini文件进行了调整.下载此文件 http://curl.haxx.se/ca/cacert.pem 并像这样在php.ini中设置路径,然后重新启动服务器.
You have do a tweak to the php.ini file. Download this file http://curl.haxx.se/ca/cacert.pem and set the path in php.ini like this and then restart the server.
;;;;;;;;;;;;;;;;;;;;
; php.ini Options ;
;;;;;;;;;;;;;;;;;;;;
curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem"
XAAMP通常使用以上路径
Above path is common for XAAMP
这将解决您的问题.
这篇关于Amazon S3上传错误SSL证书问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!