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

报错:ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) #1669

Closed
liaoshengping opened this issue Aug 28, 2019 · 5 comments

Comments

@liaoshengping
Copy link

我用的环境

  • PHP 版本:7.0
  • overtrue/wechat 版本:4.2.2
  • 是否使用了框架?框架名称:yii2

问题及现象

超哥,您好!
本地是可以的,服务器上会报错,是不是cache权限的问题,应该怎么解决?
如果不改权限,config 可以配置redis储存需要存储的数据吗?

ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /disk1/nongline-dev/vendor/symfony/cache/Psr16Cache.php:31
Stack trace:
#0 /disk1/nongline-dev/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/disk1/nongline...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Symfony\Compone...')
#2 [internal function]: spl_autoload_call('Symfony\Compone...')
#3 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/Traits/InteractsWithCache.php(107): class_exists('Symfony\Compone...')
#4 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/Traits/InteractsWithCache.php(95): EasyWeChat\Kernel\AccessToken->isSymfony43()
#5 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/Traits/InteractsWithCache.php(56): EasyWeChat\Kernel\AccessToken->createDefaultCache()
#6 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/AccessToken.php(111): EasyWeChat\Kernel\AccessToken->getCache()
#7 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/AccessToken.php(249): EasyWeChat\Kernel\AccessToken->getToken()
#8 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/AccessToken.php(205): EasyWeChat\Kernel\AccessToken->getQuery()
#9 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/BaseClient.php(219): EasyWeChat\Kernel\AccessToken->applyToRequest(Object(GuzzleHttp\Psr7\Request), Array)
#10 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php(67): EasyWeChat\Kernel\BaseClient->EasyWeChat\Kernel{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#11 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(66): GuzzleHttp\RetryMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#12 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/Middleware.php(30): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#13 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(70): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#14 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/Middleware.php(60): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#15 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/HandlerStack.php(67): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#16 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/Client.php(277): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#17 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/Client.php(125): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#18 /disk1/nongline-dev/vendor/guzzlehttp/guzzle/src/Client.php(131): GuzzleHttp\Client->requestAsync('POST', Object(GuzzleHttp\Psr7\Uri), Array)
#19 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/Traits/HasHttpRequests.php(156): GuzzleHttp\Client->request('POST', 'cgi-bin/message...', Array)
#20 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/BaseClient.php(174): EasyWeChat\Kernel\BaseClient->performRequest('cgi-bin/message...', 'POST', Array)
#21 /disk1/nongline-dev/vendor/overtrue/wechat/src/Kernel/BaseClient.php(103): EasyWeChat\Kernel\BaseClient->request('cgi-bin/message...', 'POST', Array)
#22 /disk1/nongline-dev/vendor/overtrue/wechat/src/OfficialAccount/TemplateMessage/Client.php(129): EasyWeChat\Kernel\BaseClient->httpPostJson('cgi-bin/message...', Array)
#23 /disk1/nongline-dev/api/controllers/MsgController.php(29): EasyWeChat\OfficialAccount\TemplateMessage\Client->send(Array)
#24 [internal function]: api\controllers\MsgController->actionHello()
#25 /disk1/nongline-dev/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#26 /disk1/nongline-dev/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#27 /disk1/nongline-dev/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('hello', Array)
#28 /disk1/nongline-dev/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('msg/hello', Array)
#29 /disk1/nongline-dev/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#30 /disk1/nongline-dev/api/web/index.php(17): yii\base\Application->run()
#31 {main}

@overtrue
Copy link
Collaborator

又提交一次的目的是?

@liaoshengping
Copy link
Author

又提交一次的目的是?
感谢您的回复!
不好意思,刚才以为是版本7.0不兼容,但是看文档支持7.0的,关掉了的问题可以重新打开吗?

@overtrue
Copy link
Collaborator

overtrue commented Aug 28, 2019 via email

@liaoshengping
Copy link
Author

好的,非常感谢您

@xlkit456852
Copy link

你好,这个问题是怎么解决的?我也出现这个问题了

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

3 participants