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

后端 未结 6 1357
太阳男子
太阳男子 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:40

    The AWS CLI sets credentials at ~/.aws/config, and the aws php sdk looks for them at ~/.aws/credentials.

    So:

    cd ~/.aws
    mv config credentials
    

    Solved what I think is the same problem for me.

提交回复
热议问题