Executing AWS CLI command from php results in Unable to locate credentials

后端 未结 6 1355
太阳男子
太阳男子 2020-12-11 15:56

I am trying to run aws s3 cp command from within php code using shell exec. Following is the php code.

echo shell_exec(\"sudo aws s3 cp s3:///s         


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 16:25

    From your terminal, you can then run:

    $ cat ~/.aws/config
    [profile eb-cli]
    aws_access_key_id = XXXXXX
    aws_secret_access_key = XXXXXX
    
    $ aws configure
    

    and then you will be asked for 4 values:

    1. Access Key ID (Access Key) - This is the shorter of the two values.
    2. Secret Access Key
    3. Default region name (type in 'us-east-1')
    4. Output format (type in 'json')

    then

    $ aws s3 sync s3://
    

提交回复
热议问题