Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

接口配置失败 #672

Closed
Lujidev opened this issue Apr 27, 2017 · 0 comments
Closed

接口配置失败 #672

Lujidev opened this issue Apr 27, 2017 · 0 comments

Comments

@Lujidev
Copy link

Lujidev commented Apr 27, 2017

我用的环境

PHP 版本:7.0
overtrue/wechat 版本:3.1

问题及现象

大家好,

小白来问一个问题, 关于接口配置,

目前server.php里就

<?php
include __DIR__ . '/vendor/autoload.php'; // 引入 composer 入口文件
use EasyWeChat\Foundation\Application;
$options = [
    'debug'  => true,
    'app_id' => '我的appid',
    'secret' => '我的secretid',
    'token'  => 'easywechat',

    'log' => [
        'level' => 'debug',
        'file'  => '/tmp/easywechat.log', 
    ],
    //...
];
$app = new Application($options);
$response = $app->server->serve();
// 将响应输出
$response->send(); // Laravel 里请使用:return $response;

错误是:

Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /homepages/3/d598322129/htdocs/wxapi/vendor/monolog/monolog/src/Monolog/Logger.php on line 311

Fatal error: Uncaught exception 'EasyWeChat\Server\BadRequestException' with message 'Invalid request.' in /homepages/3/d598322129/htdocs/wxapi/vendor/overtrue/wechat/src/Server/Guard.php:343 Stack trace: #0 /homepages/3/d598322129/htdocs/wxapi/vendor/overtrue/wechat/src/Server/Guard.php(359): EasyWeChat\Server\Guard->getMessage() #1 /homepages/3/d598322129/htdocs/wxapi/vendor/overtrue/wechat/src/Server/Guard.php(156): EasyWeChat\Server\Guard->handleRequest() #2 /homepages/3/d598322129/htdocs/wxapi/server.php(17): EasyWeChat\Server\Guard->serve() #3 {main} thrown in /homepages/3/d598322129/htdocs/wxapi/vendor/overtrue/wechat/src/Server/Guard.php on line 343

目前文件夹里就:
composer.json
composer.lock
composer.phar
server.php
vendor

公众平台那边是 http://我的网站/server.php

我本来已经开始用官方的文档开始, 还可以只是麻烦了一点, 半路发现easywechat 希望使用这个让代码更简单干净。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants