...
PHP

PHP读取远程URL出现 file_get_contents(): SSL operation failed with code 1. OpenSSL

get_file_contents() 这个函数想必大家都很熟悉了吧,在最近项目功能中,需要采集远程的图片资源,但是在使用 get_file_contents()时,出现 file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL

但是,在读取其他网站的URL是没有问题的

出现上面的原因,属于SSL证书不一致造成,我们只需要在 get_file_contents() 这个函数中,这样处理就可以了。

$arrContextOptions = [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
]
];
$response = file_get_contents($voucherImageBase64, false, stream_context_create($arrContextOptions));


vue 脚手架 sass安装 雨霖铃·寒蝉凄切
biu biu biu
STC8G驱动WS2812 STC8G使用串口打印调试 记录一次单片机IO接线太长导致中断频发或死机问题的解决办法(长线通讯噪声抑制方法) js将字符串数字数组转换成uint8Array数组,用于mcu通讯指令。 金蝶发票助手打开提示:本功能基于跨技术平台的嵌套方式实现,对正浏览器版本和兼容模式有要求。解决