AWS config file for PHP - suguanyu/WechatTinyProgram GitHub Wiki
## 1. Using a configuration file with the service builder Create a new aws file
<?php
return array(
// Bootstrap the configuration file with AWS specific features
'includes' => array('_aws'),
'services' => array(
// All AWS clients extend from 'default_settings'. Here we are
// overriding 'default_settings' with our default credentials and
// providing a default region setting.
'default_settings' => array(
'params' => array(
'credentials' => array(
'key' => 'YOUR_AWS_ACCESS_KEY_ID',
'secret' => 'YOUR_AWS_SECRET_ACCESS_KEY',
),
'region' => 'us-west-1'
)
)
)
);
?>
## 2. Include configure file to use aws include config.php in your cdoe *
<?php
use Aws\Common\Aws;
// Create the AWS service builder, providing the path to the config file
$aws = Aws::factory('/path/to/custom/config.php');
?>