简体   繁体   中英

how to add S3 authentication keys AWS SDK PHP

I do not understand where I am supposed to add my key and secret key credentials. I am using AWS SDK for php with composer. The documentation says to create a credentials file at ~/.aws/credentials.

I do not understand the filepath. Where exactly to I make this file? Do I make it at the root of the folder I am in?

This is a Unix filepath and means "in the homefolder, in .aws/credentials".

I assume you use Windows. In this case, use that path:

  C:\Users\USERNAME\.aws\credentials

"credentials" is a text file, which you could edit with Notepad. ".aws" is just the name of folder which you can create with Explorer. USERNAME is your Windows-Username.

You can read about it in the docs .

If you are on a Mac, like indicated in the comment, you can do the following:

  • Open the Terminal.app and type: mkdir ~/.aws . This will create a new folder in your home folder
  • Then type: open ~/.aws . This will open a Finder inside the .aws Folder. Then you can work usign the finder to create a file called "credentials"
  • OR: If you have Sublime Text installed, type: subl ~/.aws
  • OR: If you are familiar with VI, type: vi ~/.aws/credentials

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM