{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/887","labels_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/887/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/887/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/887/events","html_url":"https://github.com/aws/aws-sdk-php/issues/887","id":128375560,"number":887,"title":"Credentials","user":{"login":"dadixon","id":1591018,"avatar_url":"https://avatars.githubusercontent.com/u/1591018?v=3","gravatar_id":"","url":"https://api.github.com/users/dadixon","html_url":"https://github.com/dadixon","followers_url":"https://api.github.com/users/dadixon/followers","following_url":"https://api.github.com/users/dadixon/following{/other_user}","gists_url":"https://api.github.com/users/dadixon/gists{/gist_id}","starred_url":"https://api.github.com/users/dadixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadixon/subscriptions","organizations_url":"https://api.github.com/users/dadixon/orgs","repos_url":"https://api.github.com/users/dadixon/repos","events_url":"https://api.github.com/users/dadixon/events{/privacy}","received_events_url":"https://api.github.com/users/dadixon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-24T05:55:29Z","updated_at":"2016-01-24T06:07:49Z","closed_at":"2016-01-24T06:07:49Z","body":"I'm using was version 3.14.1. I cannot get the credentials to give read right from the server.  Even hard coding the key and secret doesn't work.  I created ~/.aws/credentials.ini file that just has my key and secret in it.  After that I try to call $s3Client = new S3Client([version, region, profile, etc.]).  Doesn't work.  Then I try the same code with my key and secret inside and that works.  Please  help"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/comments/174260184","html_url":"https://github.com/aws/aws-sdk-php/issues/887#issuecomment-174260184","issue_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/887","id":174260184,"user":{"login":"jeskew","id":705500,"avatar_url":"https://avatars.githubusercontent.com/u/705500?v=3","gravatar_id":"","url":"https://api.github.com/users/jeskew","html_url":"https://github.com/jeskew","followers_url":"https://api.github.com/users/jeskew/followers","following_url":"https://api.github.com/users/jeskew/following{/other_user}","gists_url":"https://api.github.com/users/jeskew/gists{/gist_id}","starred_url":"https://api.github.com/users/jeskew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeskew/subscriptions","organizations_url":"https://api.github.com/users/jeskew/orgs","repos_url":"https://api.github.com/users/jeskew/repos","events_url":"https://api.github.com/users/jeskew/events{/privacy}","received_events_url":"https://api.github.com/users/jeskew/received_events","type":"User","site_admin":false},"created_at":"2016-01-24T06:07:49Z","updated_at":"2016-01-24T06:07:49Z","body":"The credentials file should be in ini format but not have a `.ini` extension. It should have a 'default' section defined with your key and secret:\r\n```\r\n$ less ~/.aws/credentials\r\n\r\n[default]\r\naws_access_key_id = key\r\naws_secret_access_key = secret\r\n```\r\n\r\nUsing a [credentials file](http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html#using-the-aws-credentials-file-and-credential-profiles) or [environment variables](http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html#using-credentials-from-environment-variables) is the recommended way of providing credentials on your own server, but if you prefer to [hard code the key and secret](http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/credentials.html#using-hard-coded-credentials), it must be passed in as part of an argument hash, not as positional parameters. For example:\r\n```php\r\n$s3Client = new \\Aws\\S3\\S3Client([\r\n    'version' => '2006-03-01',\r\n    'region' => $yourPreferredRegion,\r\n    'credentials' => [\r\n        'key' => $key,\r\n        'secret' => $secret,\r\n    ],\r\n]);\r\n```"}}