2016-07-29 134 views
1

我試圖測試Laravel亞馬遜S3在我的本地主機,但繼續得到同樣的錯誤:亞馬遜S3上傳錯誤SSL證書問題

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'); 

回答

6

你必須做調整到php.ini文件。下載這個文件http://curl.haxx.se/ca/cacert.pem並像這樣在php.ini中設置路徑,然後重新啓動服務器。

;;;;;;;;;;;;;;;;;;;; 
; php.ini Options ; 
;;;;;;;;;;;;;;;;;;;; 

curl.cainfo = "C:\xampp\php\extras\ssl\cacert.pem" 

上述路徑是很常見的XAAMP

這將解決您的問題。

+0

我在php.ini中加入了cacert.pem這樣的文件路徑[cURL] curl.cainfo ='C:\ xampp \ cacert.pem'但是仍然顯示相同的錯誤 –

+0

您是否確定路徑與文件 – error2007s

+0

是的,我確定有其他步驟來設置路徑? –