zoukankan      html  css  js  c++  java
  • 解决AWS S3 报SSL (60) 错误

    环境 : xampp

    php : 7.3

    在更新了PHP版本之后显示调用S3的 doesObjectExist 一直显示失败, 然后打开调试模式

    try {
        self::$obj = new S3Client([
            // 地区 亚太区域(新加坡) ap-southeast-1
            'region' => self::$config['region'],
    
            //
            'version' => self::$config['version'],
    
            // 加载证书
            'credentials' => new Credentials(self::$config['key'], self::$config['secret']),
    
            // 开启bug调试
            'debug' => true
    
        ]);
    } catch (S3Exception $e) {
        Log::record($e->getMessage());
        die();
    }

    显示报错误为,

    cURL错误60:SSL证书问题:无法获取本地颁发者证书(请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html ) 

    排查了下发现是php.ini里面的 curl.cainfo  没有设置, 

    [curl]
    ; A default value for the CURLOPT_CAINFO option. This is required to be an
    ; absolute path.
    ; curl.cainfo =

    修改完, 重启服务, 错误完美解决

    参考链接

    https://stackoverflow.com/questions/38667165/amazon-s3-upload-error-ssl-certificate-issues

    https://www.656463.com/wenda/AmazonS3sccwSSLzswt_391

    https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/s3-examples-creating-buckets.html

  • 相关阅读:
    字段操作
    数据操作
    表操作
    数据库操作
    如何连接mysql
    mysql新增用户和修改用户密码
    表和库和服务器的关系
    MySql的复合类型
    yum软件源
    常用正则表达式
  • 原文地址:https://www.cnblogs.com/http-500/p/14836921.html
Copyright © 2011-2022 走看看