0
votes

I am trying to use the listbuckets method on aws S3 api and keep getting and error saying that my S3client object is undefined ERROR- Undefined variable: s3client in C:\XAMPPmy\htdocs.. Not sure why but any help would be awesome.

I am using my root account key and secret access credentials

php code that is trying to use S3 service -

$s3Client = new Aws\S3\S3Client([
'version'     => 'latest',
'region'      => 'us-west-2',
'credentials' => [
    'key'    => 'key',
    'secret' => 'secret',
],]);  $result = $s3client->listBuckets();
1

1 Answers

1
votes

You have a variable casing problem: $s3client versus $s3Client.