AWS SDK的PHP的例子?例子、AWS、SDK、PHP

由网友(十足痞子味)分享简介:我想(万物)我的AWS EC2服务器上安装的AWS SDK的PHP。我的认为的我已经安装它,但似乎无法弄清楚如何使用它。所有code的例子我能找到的是S3。我在寻找一个 PHP code示例使用AWS SDK的PHP版本2.x做的什么的与亚马逊EC2 。 I am trying to install the AWS...

我想(万物)我的AWS EC2服务器上安装的AWS SDK的PHP。我的认为的我已经安装它,但似乎无法弄清楚如何使用它。所有code的例子我能找到的是S3。我在寻找一个 PHP code示例使用AWS SDK的PHP版本2.x做的什么的与亚马逊EC2 。

I am trying to install the AWS SDK for PHP on my (of all things) AWS EC2 server. I think I have it installed, but can't seem to figure out how to use it. All of the code examples I can find are for S3. I'm looking for a PHP Code Example for using the AWS SDK for PHP v2.x to do anything with Amazon EC2.

即使它只是列出我的当前运行情况。没什么特别的,我只需要看到它的工作。

Even if it just lists my currently running instances. Nothing fancy, I just need to see it work.

我已经安装使用梨的SDK。

I've installed the SDK using Pear.

推荐答案

维克托Smirnow已经采取的时间来提供的如何获得EC2实例的列表与Amazon PHP SDK 2 (+1个) - 因此,你应该简单地检查他的回答更多细节,但短期的版本使用通过AWS SDK的PHP 2 describeInstances 方法要求可以归结为:

Victor Smirnow has already taken the time to provide a question and elaborate answer on How to get list of EC2 instances with Amazon PHP SDK 2 (+1 each) - accordingly you should simply check his answer for more details, but the short version for using the DescribeInstances API action via the AWS SDK for PHP 2 describeInstances method as requested boils down to:

$config = array();
$config['key'] = 'key';
$config['secret'] = 'secret';
$config['region'] = 'us-east-1';
$ec2Client = AwsEc2Ec2Client::factory($config);

$result = $ec2Client->DescribeInstances();
阅读全文

相关推荐

最新文章