这段代码有一些问题:
$ec2 = Ec2Client::factory(array(
'AWS_KEY' => AWS_KEY,
'AWS_SECRET_KEY' => AWS_SECRET_KEY,
'region' => 'us-east-1',
));
echo "<pre>";
var_dump($ec2->describeInstances());
我经常收到这个:
Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 28: Connection time-out [url] http://169.254.169.254/latest/meta-data/iam/security-credentials/' in /**/**/**/htdocs/**/vendor/Guzzle/Http/Curl/CurlMulti.php:578
如果我使用$aws = AWS::factory()
后跟,我也会收到这个$ec2 = $aws->get('ec2')