微信公众平台开发者模式 关注后没有自动回复

php后台实现微信公众平台的关注后自动回复功能,但是没有信息返回,代码如下
public function index(){
$request = Request::instance();
$get = $request->param();
$timestamp = $get['timestamp'];
$nonce = $get['nonce'];
$token = "weiwei";
$signature = $get['signature'];
$echostr = $get['echostr'];

$array = array();
$array = array($token,$timestamp,$nonce);
sort($array);
$tmpstr = sha1(implode('',$array));

if($tmpstr == $signature){
if (!isset($get['echostr'])) {
$this->responText();
}else{
ob_clean();
echo $get['echostr'];
exit;
}
}
}

private function responText(){
    $getInfo = $GLOBALS["HTTP_RAW_POST_DATA"];
    $InfoObj = simplexml_load_string($getInfo);

    if (strtolower(trim($InfoObj->MsgType))=='event') {
        if (strtolower($InfoObj->Event)=='subscribe') {

            $tousername = $InfoObj->FromUserName;
            $fromusername = $InfoObj->ToUserName;
            $ctime = time();
            $content = '欢迎关注本公众号,你果然是个聪明人';

            $Msg = "<xml>
                    <ToUserName><![CDATA[%s]]></ToUserName>
                    <FromUserName><![CDATA[%s]]></FromUserName>
                    <CreateTime>%s</CreateTime>
                    <MsgType><![CDATA[text]]></MsgType>
                    <Content><![CDATA[%s]]></Content>
                    </xml>";

            $sendMsg = sprintf($Msg,$tousername,$fromusername,$ctime,$content);
            echo $sendMsg;
        }
    }
}
    token是可以提交的,url上用的是阿里云服务器的ip地址,不是备案的域名,不知有没有影响,求大神指教!

http://blog.csdn.net/zhaokang491460192/article/details/17263341

http://www.xiaoshu168.com/php/96.html

我觉得你应该把获取微信通知的那个方法获得所有微信的参数并且变为类的属性,方便其他的方法调用,还有这个类中一定不能有跳转之类的,也会接收不到