[英]shell script running in php gives error .sh: Permission denied
[英]aws cli gives access denied when running shell_exect
在命令行上我可以运行:
aws s3 同步 s3://my_bucket。 --dryrun
正好。
但是,我试图在 Laravel 中将其作为命令运行:
public function handle()
{
$command = 'aws s3 sync s3://my_bucket . --dryrun';
shell_exec($command);
}
我得到:
致命错误:调用 ListObjectsV2 操作时发生错误 (AccessDenied):访问被拒绝
为什么相同的命令在命令行上有效,但在我的 PHP 应用程序中无效?
我听从了@Sammitch 的建议,并使用了
--profile my_config
其中 my_config 是一组命名的配置参数,使用以下命令创建:
aws configure --profile my_config
来源: AWS 创建命名配置文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.