- 核对“appkey”是否一致,不一致请以文件“config.inc.php”中的UC_KEY为准修改
网站后台→UCenter→应用管理→“应用”编辑→通信密钥
打开Discuz网站根目录 uc_server/data/config.inc.php 代码大约15行左右
“ define(‘UC_KEY’, ‘xxxxxxxxxx‘); ” - 打开Discuz网站根目录 uc_server/model/misc.php 文件;
在misc.php中搜索以下的代码,代码大约在68行左右:$port = !empty($matches['port']) ? $matches['port'] : ($matches['scheme'] == 'https' ? 443 : 80);
在这段代码下面加上以下的代码:
if(substr($url,0,5)=='https'){
$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_VERIFYPEER, FALSE);
return curl_exec($ch);
}
最后检测一下是否通讯成功.