duanrang2627 2017-04-05 08:15
浏览 66

在共享主机上为S3 php SDK 3设置Amazon aws凭据

I am installing Amazon S3 php SDK V3 on a shared hosting. I have so far done everything the aws php sdk v3 docs says apart from where and how to store the credentials

AWS_ACCESS_KEY_ID

AWS_SECRET_ACCESS_KEY

The documentation is not clear for me. This is my folder structure

home/sample/public_html/ /*index.php the root of my website*/
home/sample/public_html/media/aws/ /*s3 php v3 sdk stored here*/
home/sample/public_html/media/  /*my custom php script for upload stored here*/

My problem is basically 1) WHERE to store the credentials and 2) HOW to store the credentials

I will be glad if anyone can help thank you.

  • 写回答

1条回答 默认 最新

  • douju1365 2017-04-05 08:19
    关注

    The start of the docs link you have posted says where to put these credentials:

    The file should be placed at ~/.aws/credentials, where ~ represents your HOME directory.

    With the structure of the file being.

    The format of the AWS credentials file should look something like the following:

    [default] aws_access_key_id = YOUR_AWS_ACCESS_KEY_ID aws_secret_access_key = YOUR_AWS_SECRET_ACCESS_KEY

    [project1] aws_access_key_id = ANOTHER_AWS_ACCESS_KEY_ID aws_secret_access_key = ANOTHER_AWS_SECRET_ACCESS_KEY Each section (e.g., [default], [project1]), represents a separate credential profile. Profiles can be referenced from a SDK configuration file, or when you are instantiating a client, using the profile option:

    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程