时间: 2021-07-06 11:06:17 人气: -
今天碰到了一个关于 “with message 'file_get_contents(): SSL operation failed with code” 这种报错
网上找到了如下解决方法;
直接上php代码吧(直接贴在要返回的地方):
$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ), ); $url = 'https://www.djmbw.com'; $resoult = file_get_contents($url,false, stream_context_create($arrContextOptions));