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

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

    In order to solve the issue, Follow the following steps:

    1. copy .aws directory from /home/non-rootUser/.aws to /var/www
    2. Now change the directory to /var/www (cd /var/www)
    3. Change the permissions: /www$ sudo chmod -R 755 .aws
    4. Change Ownership /www$ sudo chown -R $USER:$USER .aws
    5. Recheck

提交回复
热议问题