file_get_contents下载一个https图片,报错如下
Warning: file_get_contents(): Failed to enable crypto
failed to open stream: operation failed in
已经在php.ini 打开openssl扩展和 fopen url
在phpinfo里面检查已经正确开启
$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false, ), ); // return file_get_contents($url); return file_get_contents($url, false, stream_context_create($arrContextOptions));
使用这段代码同样无效,仍然报此错误