使用Amazon S3 PHP sdk时设置证书验证位置时出错

Here is the code to implement Amazon S3 delete object

    require_once(APPPATH . 'libraries/aws.phar');

    $s3 = S3Client::factory(array(
                'key' => S3_KEY,
                'secret' => S3_SECRET
    ));

    $s3->deleteMatchingObjects(S3_BUCKET, "abc.mp4");

The error message is:

Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 77: error setting certificate verify locations: CAfile: /tmp/guzzle-cacert.pem CApath: none [url] https://testdomain.s3.amazonaws.com?prefix=abc.mp4' in phar:///home/in001/public_html/yoga/application/libraries/aws.phar/Guzzle/Http/Curl/CurlMulti.php:359 Stack trace: #0 phar:///home/in001/public_html/yoga/application/libraries/aws.phar/Guzzle/Http/Curl/CurlMulti.php(292): Guzzle\Http\Curl\CurlMulti->isCurlException(Object(Guzzle\Http\Message\Request), Object(Guzzle\Http\Curl\CurlHandle), Array) #1 phar:///home/in001/public_html/yoga/application/libraries/aws.phar/Guzzle/Http/Curl/CurlMulti.php(257): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\Request), Object(Guzzle\Http\Curl\CurlHandle), Array) #2 phar:///home/in001/public_html/yoga/application/libraries/aws.phar/Guzzle/Http/Curl/CurlMulti.php(240): Guzzle\Http\Curl\CurlMulti->processMessages() #3 phar:///home/in001/public_html/yo in phar:///home/in001/public_html/yoga/application/libraries/aws.phar/Aws/Common/Client/AbstractClient.php on line 258

I have followed the example here:

Delete object or bucket in Amazon S3?

and logged all parameter is correct, any idea of how to fix it?

Thanks for helping

php

1个回答



而不是使用.phar,下载zip文件</ p>

https://github.com/aws/aws-sdk-php/releases </ p>

并要求如下:</ p>

  require_once(APPPATH。'libraries / aws / aws-autoloader.php'); 
</ code> </ pre >

解决了问题</ p>
</ div>

展开原文

原文

Instead of using the .phar , download the zip file

https://github.com/aws/aws-sdk-php/releases

and require like this:

require_once(APPPATH . 'libraries/aws/aws-autoloader.php');

fixed the problem

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐