zoukankan      html  css  js  c++  java
  • PHP:cURL error 60: SSL certificate problem: unable to get local issuer certificate

    本地Windows环境, phpstudy 集成 php7 后,出现错误提示:cURL error 60: SSL certificate problem: unable to get local issuer certificate

    查询问题:SSL CA证书配置缺失导致。

    1、从CURL 官网下载CA 证书(cacert.pem)

      可 选择下载:https://curl.haxx.se/docs/caextract.html

      或 直接下载:https://curl.haxx.se/ca/cacert.pem

    2、找到 phpstudy 安装路径,对应php版本包

      例 安装路径下 php包:F:phpstudy_proExtensionsphpphp7.3.4nts

      将下载的cacert.pem文件,放入 extrasssl 文件夹下

    3、修改配置 php.ini 文件

      启用openssl, curl扩展

    extension=curl
    extension=openssl

      配置CA 证书存放位置

    [curl]
    ; A default value for the CURLOPT_CAINFO option. This is required to be an
    ; absolute path.
    curl.cainfo = "F:phpstudy_proExtensionsphpphp7.3.4ntsextrassslcacert.pem"
    
    [openssl]
    ; The location of a Certificate Authority (CA) file on the local filesystem
    ; to use when verifying the identity of SSL/TLS peers. Most users should
    ; not specify a value for this directive as PHP will attempt to use the
    ; OS-managed cert stores in its absence. If specified, this value may still
    ; be overridden on a per-stream basis via the "cafile" SSL stream context
    ; option.
    openssl.cafile="F:phpstudy_proExtensionsphpphp7.3.4ntsextrassslcacert.pem"
    
    ; If openssl.cafile is not specified or if the CA file is not found, the
    ; directory pointed to by openssl.capath is searched for a suitable
    ; certificate. This value must be a correctly hashed certificate directory.
    ; Most users should not specify a value for this directive as PHP will
    ; attempt to use the OS-managed cert stores in its absence. If specified,
    ; this value may still be overridden on a per-stream basis via the "capath"
    ; SSL stream context option.
    openssl.capath="F:phpstudy_proExtensionsphpphp7.3.4ntsextrasssl"
  • 相关阅读:
    【NOIP16提高组】换教室
    【扬中集训Day6T1】 白日梦
    【POJ 1061】 青蛙的约会
    【扬中集训DAY5T1】 交换矩阵
    【USACO】 Balanced Photo
    【USACO】 Balanced Lineup

    POJ P3352 Road Construction 解题报告
    洛谷 P2783 有机化学之神偶尔会做作弊 解题报告
    洛谷 P2300 合并神犇 解题报告
  • 原文地址:https://www.cnblogs.com/yycode/p/13280187.html
Copyright © 2011-2022 走看看