帝国论坛帝国网站管理系统交流区模板/标签/插件共享交流[分享]filegetcontents遇到https页面失败时的解决方案 【本版专题贴子】  
主题:[分享]filegetcontents遇到https页面失败时的解决方案 [加入收藏夹]   

luring
用户头衔:探花

精华贴   :3
发贴数   :2303
经验值   :7179
注册时间:2007-02-12
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 1 楼]
[分享]filegetcontents遇到https页面失败时的解决方案
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());"

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] =>
)

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的命令参照自己的配置修改。



1
2017-04-20 15:27:33 已设置保密 顶部 回复 引用 报告 编辑 删除

luring
用户头衔:探花

精华贴   :3
发贴数   :2303
经验值   :7179
注册时间:2007-02-12
信息 搜索 好友 发送悄悄话 免费开源-EBMA系统:更安全的MYSQL管理和备份系统】   [第 2 楼]

帝国里的应用场景是QQ互联登陆插件容易出这个问题。



1
2017-04-20 15:28:04 已设置保密 顶部 回复 引用 报告 编辑 删除

我是一片云
用户头衔:探花

精华贴   :0
发贴数   :2712
经验值   :7989
注册时间:2008-02-25
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 3 楼]

收藏




2017-04-21 07:50:17 已设置保密 顶部 回复 引用 报告 编辑 删除

点到为止
用户头衔:探花

精华贴   :0
发贴数   :6570
经验值   :20599
注册时间:2008-01-07
信息 搜索 好友 发送悄悄话 免费开源-EBMA系统:更安全的MYSQL管理和备份系统】   [第 4 楼]

支持一下




2017-04-25 08:07:18 已设置保密 顶部 回复 引用 报告 编辑 删除

rerere
用户头衔:探花

精华贴   :0
发贴数   :5236
经验值   :16664
注册时间:2009-08-13
信息 搜索 好友 发送悄悄话 精益求精-帝国网站管理系统7.5正式版开源发布】   [第 5 楼]

支持




2017-04-26 08:22:48 已设置保密 顶部 回复 引用 报告 编辑 删除

快速回复
内容

表情
使用EBB代码 使用smile代码 显示签名 自动分析url 自动分析img
     【进入高级模式】   (按 Ctrl+Enter 直接提交)
    顶部  加入收藏夹
关于帝国 | 广告服务 | 联系我们 | 法律声明 | 隐私条款 | 许可协议
Powered by: EBB Version 2.2.1