安装aws php sdk-意外变量 [英] installing aws php sdk - unexpected variables

查看:140
本文介绍了安装aws php sdk-意外变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用AWS php sdk,并设置了一些问题.当我运行需要自动加载器的php脚本时,出现此错误:

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

我查看了该文档,第36行是以if ($pred($value))开头的那一行.

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;
        }
    }
}

不太确定如何解决此问题,因此将不胜感激任何提示.我尝试过的事情:使用作曲家进行安装.使用.zip安装.

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.

执行以下步骤: http://docs. aws.amazon.com/aws-sdk-php/guide/latest/installation.html

推荐答案

生成器的yield 关键字需要PHP 5.5.

The yield keyword for generators requires PHP 5.5.

对没有生成器的最新版本的支持在2015年中结束.继续使用低于当前支持范围的任何方法都是一个坏主意. 考虑提高您的PHP版本.

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.

话虽如此,您可能想研究 SDK 2.8版. 8 或更低. packagist的"required"部分列出了php版本要求.

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.

这篇关于安装aws php sdk-意外变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆