Home > php教程 > php手册 > ucenter整合,通信失败,调试测试排查方法

ucenter整合,通信失败,调试测试排查方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-25 16:54:21
Original
1056 people have browsed it

本文章来给各位同学介绍关于ucenter整合,通信失败,调试测试排查方法,希望此方法对各位同学会有所帮助哦。

失败是因为你的应用程序的api/uc.php中可能有错误.比如ucenter规定.只有uc.php这个文件正常返回1,才会提示通信成功.但如果你的返回了一个sql错误.而不是1,则一定是提示失败的.怎么测试呢

<?php
include_once "config/config_global.php";
include_once "config/config_ucenter.php";
include_once "uc_client/client.php";
echo uc_user_synlogin(2); //1为用户的ID
?>
<script type="text/javascript">
var obj = document.getElementsByTagName("script");
for (var i = 0; i < obj.length - 1; i++) {
    document.write("<a href=" "+obj[i].src+" ">" + obj[i].src + "</a><hr>");
}
Copy after login

上面的代码保存成test.php文件.放在你的dz论坛或ucenter所在的根目录中,直接用域名.com/test.php 看下有什么提示错误.当然.uc.php文件中

error_reporting(0); 这一句最后先注释掉.错误会更清晰的显示.找到错误后.这一句一定要加上.否则.可能一直通信失败.


本文地址:

转载随意,但请附上文章地址:-)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
include error
From 1970-01-01 08:00:00
0
0
0
How to include a file in ubuntu?
From 1970-01-01 08:00:00
0
0
0
Why can't I load the content in include?
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template