• 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"
  • 相关阅读:
    二层、三层、四层交换机的区别
    在origin 中任意设定X坐标值
    Eclipse 配置 ONE 仿真环境
    ns3 安装
    sprintf 函数
    transition属性实现hover渐变动画效果
    Mybatis处理oracle的clob类型
    Mybatis模糊查询(like)
    java.lang.OutOfMemoryError: PermGen space错误
    ORA-28000: the account is locked-的解决办法
  • 原文地址:https://www.cnblogs.com/yycode/p/13280187.html
Copyright © 2020-2023  润新知