猫先森 發表於 2019-8-26 11:20:46

Discuz! X3.4 与 UCenter 通信失败的解决方法总结

<font face="Tahoma,">UCenter 通信异常,一般有下面的一些症状:</font><br /><font face="Tahoma,">2、网站登录提示密码不正确或者没响应;</font><br /><font face="Tahoma,">4、各应用不能同步登录和退出;</font><br /><font face="Tahoma,">6、头像显示红X;</font><br /><font face="Tahoma,">还有很多各种各样的情况,这里就不一一列举了。</font><br /><br /><font face="Tahoma,">:</font><br /><br /><font face="Tahoma,">以Discuz! X2.5为例,配置文件的目录为:./config/config_ucenter.php 找到如下图所示的位置</font><br /><br /><img title="161748z75z8vtuz22y7iwq.gif.thumb.jpg" id="aimg_2613" aid="2613" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133949vc8x4bheccbzkhub.jpg" src="https://www.dismall.com/data/attachment/forum/201908/27/133949vc8x4bheccbzkhub.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /> <br /><br /><font face="Tahoma,"><br />2、应用的主 URL 地址即站点地址必须与 UCenter 后台的应用地址相同</font><br /><font face="Tahoma, Microsoft Yahei, Simsun">比如站点的访问地址为:https: //www.dismall.com ,那么 UCenter 后台该应用的地址也必须是 https: //www.dismall.com。</font><br /><br /><img title="161748bzxnnyxpjpxwwhv0.gif.thumb.jpg" id="aimg_2615" aid="2615" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133949h96imzky65idls6y.jpg" src="https://www.dismall.com/data/attachment/forum/201908/27/133949h96imzky65idls6y.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /> <br /><font face="Tahoma,">配置文件的通信密钥可以在./config/config_ucenter.php 中看到。</font><br /><br /><img title="161749etetd3um3ggv6n6b.gif.thumb.jpg" id="aimg_2616" aid="2616" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133949s96szgv9azgaoxax.jpg" src="https://www.dismall.com/data/attachment/forum/201908/27/133949s96szgv9azgaoxax.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /> <br /><font face="Tahoma,"><br />4、UCenter IP 地址要与服务器的 ip 地址相同</font><br /><font face="Tahoma,">同理,UCenter 后台的应用 IP 地址也要和配置文件中的一致。</font><br /><font face="Tahoma,">5、检查配置文件中的表前缀是否填写正确<br /></font><font face="Tahoma,">6、fsockopen函数被禁用</font><br /><font face="Tahoma,">将其改为</font><ol><li>allow_url_fopen = On</ol><br /><font face="Tahoma,">301重定向可以用fsockopen函数进行测试:用下面的代码</font><ol><li>$fp = fsockopen(&quot;www.example.com&quot;, 80, $errno, $errstr, 30);<br /><li>if (!$fp) {<br /><li>&nbsp; &nbsp; echo &quot;$errstr ($errno)<br /><li>&quot;;<br /><li>} else {<br /><li>&nbsp; &nbsp; $out = &quot;GET / HTTP/1.1&quot;;<br /><li>&nbsp; &nbsp; $out .= &quot;Host: www.example.com&quot;;<br /><li>&nbsp; &nbsp; $out .= &quot;Connection: Close&quot;;<br /><li>&nbsp; &nbsp; fwrite($fp, $out);<br /><li>&nbsp; &nbsp; while (!feof($fp)) {<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;echo fgets($fp, 128);<br /><li>&nbsp; &nbsp; }<br /><li>&nbsp; &nbsp; fclose($fp);<br /><li>}<br /><li>?&gt;</ol><br /><font face="Tahoma,">您只要取消重定向即可,一般是 301 跳转规则有问题。</font><br /><br />通过以上方法,便可以解决通信失败的问题。通常只要目录权限正确,配置文件和后台设置按照上面方法操作通信就不会出现问题了。<br /><br /><br /><br />Tahoma<em>, </em>UCenter<em>, </em>通信<em>, </em>配置文件<strong>更多图片</strong>小图大图<img title="161749etetd3um3ggv6n6b.gif.thumb.jpg" id="aimg_2614" aid="2614" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133949b1ru41ve9f4zvrdp.jpg" src="https://www.dismall.com/data/attachment/forum/201908/27/133949b1ru41ve9f4zvrdp.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" alt="161748r9cwqlzlcym24d0z.gif.thumb.jpg" title="161748r9cwqlzlcym24d0z.gif.thumb.jpg" w="600" /><img title="161749etetd3um3ggv6n6b.gif.thumb.jpg" id="aimg_2617" aid="2617" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133950pxn1y9omkyqswnwo.jpg" src="https://www.dismall.com/data/attachment/forum/201908/27/133950pxn1y9omkyqswnwo.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" alt="161749ijjjx8ujruxyrzbi.gif.thumb.jpg" title="161749ijjjx8ujruxyrzbi.gif.thumb.jpg" w="600" /><img title="161749etetd3um3ggv6n6b.gif.thumb.jpg" id="aimg_2618" aid="2618" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133950ik9z8qew9nkjhtwz.jpg" src="https://www.dismall.com/data/attachment/forum/201908/27/133950ik9z8qew9nkjhtwz.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" alt="161750g7vjinn92sga37s4.gif.thumb.jpg" title="161750g7vjinn92sga37s4.gif.thumb.jpg" w="600" /><img title="161749etetd3um3ggv6n6b.gif.thumb.jpg" id="aimg_2619" aid="2619" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133950m59xq8u58q88u5sb.gif" src="https://www.dismall.com/data/attachment/forum/201908/27/133950m59xq8u58q88u5sb.gif" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="373" alt="161750r3i882ykvi8i523i.gif" title="161750r3i882ykvi8i523i.gif" w="373" /><img title="161749etetd3um3ggv6n6b.gif.thumb.jpg" id="aimg_2620" aid="2620" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/201908/27/133950pw0z6eywbngy6z76.gif" src="https://www.dismall.com/data/attachment/forum/201908/27/133950pw0z6eywbngy6z76.gif" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="511" alt="1617509qvqnxuvqgvl19gq.gif" title="1617509qvqnxuvqgvl19gq.gif" w="511" /> 组图打开中,请稍候......
頁: [1]
查看完整版本: Discuz! X3.4 与 UCenter 通信失败的解决方法总结