Amazon S3 Upload error SSL certificate issues

孤街浪徒 提交于 2019-12-06 11:04:01

问题


I'm trying to test Laravel Amazon S3 on my localhost but keep getting the same error:

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)

My code :

$s3 = \Storage::disk('s3');
$filePath = '/images/' . $filename;
$s3->put($filePath, file_get_contents($image), 'public');

回答1:


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"

Above path is common for XAAMP

And that will fix your issue.



来源:https://stackoverflow.com/questions/38667165/amazon-s3-upload-error-ssl-certificate-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!