我使用Red Hat EC2实例来运行AWS CLI命令并使用Glacier和S3管理某些任务。我还正在设计Rest API,以执行我在EC2上部署的脚本。使用Postman将POST请求发送到EC2的公共DNS地址,我的脚本将采用原始JSON并将其解码为PHP脚本将采用的参数。当我尝试在自己的内部执行AWS CLI命令时遇到错误PHP脚本。当我在终端中运行它们时,AWS命令将起作用。我从这个线程尝试过的事情https://github.com/aws/aws-cli/issues/3542:pip安装AWScli而不是pip安装AWS降级AWSversions和Botocore邮递员回应Traceback (most recent call last): File "/usr/bin/aws", line 19, in <module> import awscli.clidriver File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 17, in <module> import botocore.session File "/usr/lib/python2.7/site-packages/botocore/session.py", line 30, in <module> import botocore.credentials File "/usr/lib/python2.7/site-packages/botocore/credentials.py", line 42, in <module> from botocore.utils import InstanceMetadataFetcher, parse_key_val_file File "/usr/lib/python2.7/site-packages/botocore/utils.py", line 31, in <module> import botocore.httpsession File "/usr/lib/python2.7/site-packages/botocore/httpsession.py", line 7, in <module> from urllib3.util.ssl_ import (ImportError: cannot import name DEFAULT_CIPHERSPHP脚本exec("aws s3 cp s3://$BucketName /path/to/dir/ --recursive 2>&1",$output,$return);我希望AWS CLI命令由exec命令执行,并返回一个字符串输出,我将其作为响应发送回去。
- 3 回答
- 0 关注
- 377 浏览
添加回答
举报
0/150
提交
取消