dousu1900 2010-09-14 03:15
浏览 31
已采纳

解析错误:Zend_Oauth :: REQUEST_SCHEME_HEADER错误:意外','期待'(''

Using PHP GMail OAuth Library/Sample.

$options = array(
    'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER,
    'version' => '1.0',
    'consumerKey' => $THREE_LEGGED_CONSUMER_KEY,
    'callbackUrl' => getCurrentUrl(),
    'requestTokenUrl' => 'https://www.google.com/accounts/OAuthGetRequestToken',
    'userAuthorizationUrl' => 'https://www.google.com/accounts/OAuthAuthorizeToken',
    'accessTokenUrl' => 'https://www.google.com/accounts/OAuthGetAccessToken'
);

Here's the error: Parse error: syntax error, unexpected ',', expecting '(' This is from line 77: the 'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER, line, any ideas?

Edit: I'm using PHP 4.4.8

  • 写回答

2条回答 默认 最新

  • doushangxianq07480 2010-09-14 03:29
    关注

    You're using PHP 4, which does not support class constants; when it sees code like that, it's expecting a static function call, which it does support:

    Class::static_function()
    

    However, in the case of your code, the Zend_Oauth class has a const REQUEST_SCHEME_HEADER, a PHP 5-only feature, which is accessed like so:

    Zend_Oauth::REQUEST_SCHEME_HEADER
    

    This is why Zend Framework requires PHP 5. If you intend to use it, yes you'll need to contact your hosting provider to see if they offer PHP 5 as an option or something.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)