当前位置:论坛首页 > Linux面板 > 建议

php7.1的ssl配置是错误的,cert.pem不存在

发表在 Linux面板2017-4-20 15:29 [复制链接] 0 3207

First:

Check certificate file location which will be in default_cert_file key, you will found it in openssl_get_cert_locations() its php openssl function:
第一步:需找验证钥匙的地址,使用 php函数openssl_get_cert_locations().

$ php -r "print_r(openssl_get_cert_locations());"
[html]Array
(
    [default_cert_file] => /opt/lampp/share/openssl/cert.pem
    [default_cert_file_env] => SSL_CERT_FILE
    [default_cert_dir] => /opt/lampp/share/openssl/certs
    [default_cert_dir_env] => SSL_CERT_DIR
    [default_private_dir] => /opt/lampp/share/openssl/private
    [default_default_cert_area] => /opt/lampp/share/openssl
    [ini_cafile] =>
    [ini_capath] =>
)[/html]
Second:

Download http://curl.haxx.se/ca/cacert.pem:
第二步:下载最新的cacert.pem,从上面这个网址下。

$ wget http://curl.haxx.se/ca/cacert.pem
Third:

Copy certificate PEM file into default_cert_file location:
第三步:建立openssl到默认cert文件到连接。

$ sudo mv cacert.pem /opt/lampp/share/openssl/cert.pem
My php-cli is under XAMPP and default_cert_file maybe point to some place that is different than this.
注意:这个要跟上面第一步找到到地址一致。

Fourth:

Restart xampp:
重启xampp

$ sudo /opt/lampp/xampp restart
I hope anything after that should goes fine with you brothers.
希望你顺利解决。

路径和重启php的命令参照自己的配置修改。

使用道具 举报 只看该作者 回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表