Fork me on Baidu

file_get_contents 避免出现按个 ssl -60 的报错 ,不进行数据验证 或者 使用php.ini 进行文件配置

1, 使用不去验证数据
$stream_opts
= [ "ssl" => [ "verify_peer" => false, "verify_peer_name" => false, ] ]; $user_info = json_decode(file_get_contents($user_info_url, false, stream_context_create($stream_opts)));
2,配置 php.ini
D:\phpstudy_pro\Extensions\php\php7.2.9nts\extras\ssl
curl.cainfo = "D:\phpstudy_pro\Extensions\php\php7.2.9nts\extras\ssl\cacert-2023-08-22.pem"
文件 放到了百度网盘里面 自行下载就好
链接: https://pan.baidu.com/s/1rg7xKJjd_-h_McIETPmlXg?pwd=bnhd 提取码: bnhd
posted @ 2024-02-02 13:58  consideration  阅读(25)  评论(0)    收藏  举报