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"
  • 相关阅读:
    Context对象还提供了相应的属性来调整线条及填充风格
    基本类型互相之间转化可以用Covent类来实现。
    chfn是用来改变你的finger讯息
    在Web根目录下建立testdb.php文件内容
    springmvc接口接收json类型参数设置
    表单类型参数样板
    git push 免密码
    git提交之后没有push,代码被覆盖之后恢复
    测试流程总结
    linux 更改时区
  • 原文地址:https://www.cnblogs.com/yycode/p/13280187.html
Copyright © 2011-2022 走看看