Discuz! X 开启https后UCenter通信失败
问题现象:
Discuz! X 开启https后UCenter显示通信失败,通信密钥正确,数据库信息正确
解决方法:
1. 修改文件uc_server/model/misc.php
2. 查找$port = !empty($matches['port'])
3. 在下方插入代码
if(substr($url,0,5)=='https'){
//var_dump($url);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($post){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
if($cookie){
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
return curl_exec($ch);
}