2012-10-03 66 views
0

我已下載適用於PHP的AWS(亞馬遜)SDK,並放置了亞馬遜Web服務所需的憑證。然後我運行樣本文件夾btu中的示例代碼文件名(cli-ec2_sorting_and_filtering.php),我收到以下錯誤消息。在使用PHP的亞馬遜Web服務時使用curl(php)的SSL證書

Fatal error: Uncaught exception 'cURL_Exception' with message 'cURL resource: Resource id #13; cURL error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (cURL error code 60). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.' in C:\xampp\htdocs\amazon\lib\requestcore\requestcore.class.php:843 Stack trace: #0 C:\xampp\htdocs\amazon\sdk.class.php(1037): RequestCore->send_request() #1 C:\xampp\htdocs\amazon\services\ec2.class.php(2270): CFRuntime->authenticate('DescribeImages', Array) #2 C:\xampp\htdocs\amazon\_samples\cli-ec2_sorting_and_filtering.php(62): AmazonEC2->describe_images() #3 {main} thrown in C:\xampp\htdocs\amazon\lib\requestcore\requestcore.class.php on line 843

+0

請發佈您的php代碼'cli-ec2_sorting_and_filtering.php' –

+0

這是示例代碼,由亞馬遜提供 '\t error_reporting(-1); header(「Content-type:text/html; charset = utf-8」); require_once'../sdk.class.php'; $ ec2 = new AmazonEC2(); $ response = $ ec2-> describe_images(); $ akis = array(); foreach($ response-> body-> imagesSet-> item as $ item){ \t \t $ image_id =(string)$ item-> imageId; if(preg_match('/ aki/i',$ image_id)){ \t $ akis [] = $ image_id; \t \t} \t} \t //顯示 \t的print_r($阿基斯);」 –

回答

0

你必須有這樣的:

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 

如果它已經存在,你需要將其更改爲false。希望這可以幫助。