dtcu5885 2015-06-01 10:37
浏览 64
已采纳

安装aws php sdk - 意外变量

I'm trying to use the AWS php sdk, and having some issues getting set up. I'm getting this error when I run my php script that requires the autoloader:

Parse error: syntax error, unexpected '$value' (T_VARIABLE) in /[directory path]/Aws/functions.php on line 36

I looked in that document, and line 36 is the one that begins with if ($pred($value)).

function filter($iterable, callable $pred){
    foreach ($iterable as $value) {
        if ($pred($value)) {
            yield $value;
        }
    }
}

Not really sure how to work around this, so any tips would be greatly appreciated. Things I've tried: installing with composer. installing with .zip.

Followed these steps: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html

  • 写回答

1条回答 默认 最新

  • doubianyu7844 2015-06-01 13:29
    关注

    The yield keyword for generators requires PHP 5.5.

    Support for the last version that didn't have generators ended mid-late 2015. Continuing to use anything below what is currently supported is a bad idea. Consider bumping your PHP version.

    Having said that, you may want to investigate sdk version 2.8.8 or lower. The 'required' sections of packagist list the php version requirements.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

问题事件

  • 专家修改了标签 8月18日

悬赏问题

  • ¥100 二维码被拦截如何处理
  • ¥15 怎么解决LogIn.vue中多出来的div
  • ¥15 优博讯dt50巴枪怎么提取镜像
  • ¥30 在CodBlock上用c++语言运行
  • ¥15 求C6748 IIC EEPROM程序固化烧写算法
  • ¥50 关于#php#的问题,请各位专家解答!
  • ¥15 python 3.8.0版本,安装官方库ibm_db遇到问题,提示找不到ibm_db模块。如何解决?
  • ¥15 TMUXHS4412如何防止静电,
  • ¥30 Metashape软件中如何将建模后的图像中的植被与庄稼点云删除
  • ¥20 机械振动学课后习题求解答
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部