EasyWechat一直在报错

我的环境是 Ubuntu 14.04.4 , Nginx php7.0 , Laravel 5.2
以下是错误信息

in Guard.php line 342
at Guard->getMessage() in Guard.php line 358
at Guard->handleRequest() in Guard.php line 155
at Guard->serve() in WechatSenior.php line 90
at WechatSenior->__construct(object(Wechat)) in ServiceController.php line 31
at ServiceController->index('8')
at call_user_func_array(array(object(ServiceController), 'index'), array('id' => '8')) in Controller.php line 80
at Controller->callAction('index', array('id' => '8')) in ControllerDispatcher.php line 146
at ControllerDispatcher->call(object(ServiceController), object(Route), 'index') in ControllerDispatcher.php line 94
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(ServiceController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Home\ServiceController', 'index') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 724

我的代码如下

$options = [
            'app_id'  => $this->wechat->app_id,
            'secret'  => $this->wechat->app_secret,
            'token'   => $this->wechat->data->token,
            'aes_key' => $this->wechat->data->aes,

            'debug'=> true,
            'log' => [
                'level'      => 'debug',
                'permission' => 0777,
                'file'       => '/tmp/easywechat.log',
            ],
        ];
        $app = new Application($options);
        $server = $app->server;
        $server->setMessageHandler(function($message){
            return 'Message';
        });

        return $server->serve();

程序执行到最后一行

return $server->serve();

的时候就会报错,不知道是什么原因?难道有什么模块没有打开的原因?

这个问题已解决。我一直在尝试访问这个token验证的URL ,因为没有任何来自微信的请求,所以我们在访问时它直接就报错。不用管有没有报错,直接实现你的代码逻辑就行了。只要有微信的请求那就不会发生任何错误的。

ilchin
修改的评论也不能少于六个字哦!
ilchin
修改的评论也不能少于六个字哦!
JellyBool
修改的评论也不能少于六个字哦!
wenjie_zheng
修改的评论也不能少于六个字哦!
ilchin 回复 wenjie_zheng
修改的评论也不能少于六个字哦!
ilchin
修改的评论也不能少于六个字哦!