...
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
分享一个微信朋友圈点赞秒赞软件,无需下载一秒几千赞 js 通过坐标计算两个坐标之间的距离 edge浏览器google浏览器显示由该组织管理由你的组织管理解决方法 共享打印机连接错误提示错误代码 0x0000000a 解决方法 数据磁盘满了后增加新硬盘扩展原硬盘软链接(mklink)方案