dongshi4078 2015-09-08 07:53
浏览 123
已采纳

使用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

  • 写回答

1条回答 默认 最新

  • dongshendi3599 2015-09-09 07:02
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 聚类分析或者python进行数据分析
  • ¥15 如何用visual studio code实现html页面
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?