Php 执行错误";ListBucket";关于;https://s3-us-west-2.amazonaws.com/ :此错误的原因可能是什么?

Php 执行错误";ListBucket";关于;https://s3-us-west-2.amazonaws.com/ :此错误的原因可能是什么?,php,amazon-web-services,amazon-s3,amazon-ec2,Php,Amazon Web Services,Amazon S3,Amazon Ec2,当我试图列出bucket时,我遇到以下php错误: ( ! ) Fatal error: Uncaught exception 'Aws\S3\Exception\S3Exception' with message 'Error executing "ListBuckets" on "https://s3-us-west-2.amazonaws.com/"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to ge

当我试图列出
bucket
时,我遇到以下php错误:

( ! ) Fatal error: Uncaught exception 'Aws\S3\Exception\S3Exception' with message 
'Error executing "ListBuckets" on "https://s3-us-west-2.amazonaws.com/";
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)' in 
C:\wamp\www\Web_Projects\aws\Aws\WrappedHttpHandler.php on line 159

( ! ) Aws\S3\Exception\S3Exception: Error executing "ListBuckets" on 
"https://s3-us-west-2.amazonaws.com/"; 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) in 
C:\wamp\www\Web_Projects\aws\Aws\WrappedHttpHandler.php on line 159
Call Stack
我尝试使用的代码:

<?php
    error_reporting(1);

    require 'aws-autoloader.php';
    use Aws\S3\S3Client;


    $options = [
        'region'            => 'us-west-2',
        'version'           => 'latest',
        'credentials' => [
            'key'    => 'AKXXXXXXLPPHXXXXXXXXXPA',
            'secret' => 'a/b/c+d',
        ]
    ];

    $s3Client = new S3Client($options);
    $s3Client->listBuckets();

?>


出现上述错误的原因可能是什么?

这些错误指的是在本地密钥库中查找发出的根中间CA时出现问题:

AWS HTTP error: cURL error 60: SSL certificate problem: unable to get 
local issuer certificate
如中所示,错误60为:

CURLE_SSL_CACERT (60) Peer certificate cannot be authenticated with known CA certificates.
尝试以下操作:使用CURL的命令行版本连接到您所引用的HTTPS url:

curl https://www.example.com
您应该看到以下消息:

>curl  https://www.example.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
按照上述和中提供的说明进行操作。同时运行以帮助分析任何可能的问题

通过命令行确认并修复后,重新运行代码。它应该运行正常