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"
文件 放到了百度网盘里面 自行下载就好
链接:cacert 文件地址提取码: bnhd