我试图使用shell exec从php代码中运行aws s3 cp命令.以下是php代码.
echo shell_exec("sudo aws s3 cp s3://<bucket>/somefolder/somefile s3://<bucket>/someotherfolder/somefile --region ap-southeast-1 --acl public-read");
Run Code Online (Sandbox Code Playgroud)
文件未被复制,echo的输出如下
"无法找到凭据已完成1个部分,其中包含...文件"
注1:我已经使用aws configure命令设置了凭据
注意2:如果我直接从终端运行完全相同的命令,它工作正常.
任何的想法?