file_get_contents 忽略ssl验证

if (strpos($employee['avatar'], 'http') !== false) {
// 获取https头像 取消ssl验证
$arrContextOptions = [
"ssl" => [
"verify_peer"=>false,
"verify_peer_name"=>false,
],
];

// 远程绝对路径 上传到cdn
$path = "uploads/ueditor/image/default/" . date("Ym/d", time()) . '0_' . time() . '_' . str_random(10) . '.png';
$path = ImageUploadHandler::uploadFileStreamToCdn($path, file_get_contents($employee['avatar'], false, stream_context_create($arrContextOptions)));
}
posted @ 2019-06-17 14:07  迷失在路上  阅读(1776)  评论(0编辑  收藏  举报