2014-06-19 77 views
0

我在微信沙箱环境中提交我的URL和令牌后弹出“配置失败”。任何人都可以建议调试或找到解决方案吗?以下是详细信息:WeChat SandBox API配置失败

  • 运行Heroku服务器并使用heroku生成的URL。
  • 推送了文档中的示例代码here
  • 按照YouTube教程,复制了代码并尝试了这一点。
<?php 

$data[] = 'Test123'; 
$data[] = $_GET['timestamp']; 
$data[] = $_GET['nonce']; 

asort($data); 

$strData = ''; 
$d = ''; 
$authString = ''; 
foreach($data as $d){ 
$authString .= $d; 
} 


//verify the signture 
if(sha1($authString) == $_GET[signature]){ 
//check if the echostr 
    if(!empty($_GET['echostr'])){ 
    echo $_GET['echostr']; 
    die(); 
}else{ 
//logic goes here 
     $return = '<xml> 
       <ToUserName><![CDATA['.$toUser.']]></ToUserName> 
       <FromUserName><![CDATA['.$fromUser.']]></FromUserName> 
       <CreateTime>'.time().'</CreateTime> 
       <MsgType><![CDATA[text]]></MsgType> 
       <Content><![CDATA['.$text.']]></Content> 
       <FuncFlag>0</FuncFlag> 
       </xml>'; 
       echo $return; 
    } 
}else{ 
    die('You are not supposed to be here'); 
} 


?> 
  • 检查日志,发现其工作正常,但没有显示出活动时,我提交的URL和令牌上微信的沙箱。
  • 已尝试使用URL的不同变体,从使用根URL到使用php文件完成,例如xxxx/responder.php
  • 已提交的令牌与代码中使用的令牌相匹配。
  • 将原始php上传到服务器,用文档代码或youtube代码劫持了heroku php hello world app

代码本身直接来自微信公众号或Youtube视频。请让我知道我是否可以提供任何其他信息。

任何意见,提示或提示将非常感激。

+0

我也尝试使用托管帐户。 URL http://smartaverage.com/wechat/first/first_app.php没有成功。同样,在查看应用服务器的原始访问日志时,在URL和TOKEN提交之后,它们不会显示来自微信服务器的任何请求的记录,也不会包含任何四个预期的GET参数 – user3757887

回答

0

请检查。 International的沙箱环境已被打破。这应该现在解决。请再次测试