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
The AWS SDK for PHP includes a ZIP file containing all the classes and dependencies you need to run the SDK. Additionally, the ZIP file includes a class autoloader for the AWS SDK for PHP and its dependencies. To install the SDK, download the . zip file, and then extract it into your project at a location you choose.
The SDK is a modern, open-source PHP library that makes it easy to integrate your PHP application with AWS services like Amazon S3, Amazon Glacier, and Amazon DynamoDB.
To make requests to Amazon Web Services, you first create a service client object. The recommended way is to use the service client builder. Each AWS service has a service interface with methods for each action in the service API. For example, the service interface for DynamoDB is named AmazonDynamoDBClient.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With