2011年5月26日木曜日

AWS SDK for PHP の導入(simple版)

SDKの導入のメモ。
まぁ、Amazonのチュートリアル 通り。


◆SDKを下記サイトからダウンロード
   http://aws.amazon.com/sdkforphp

◆ダウンロードしたzipファイルを解凍
  > unzip sdk-latest.zip

◆回答したディレクトリ内のconfig-sample.inc.phpをコピー。
  > cp -p config-sample.inc.php config.inc.php

◆config.inc.php を下記のように修正。
値はAWSのアカウントページのセキュリティ証明書のページから取得する。
英語表記と日本語訳が微妙に異なってるので若干詰まった。

config.inc.php

/**
* Stores your AWS account information. Add your account information, and then rename this file
* to 'config.inc.php'.
*
* @version 2011.01.20
* @license See the included NOTICE.md file for more information.
* @copyright See the included NOTICE.md file for more information.
* @link http://aws.amazon.com/php/ PHP Developer Center
* @link http://aws.amazon.com/security-credentials AWS Security Credentials
*/
/**
* Amazon Web Services Key. Found in the AWS Security Credentials. You can also pass this value as the first
* parameter to a service constructor.
*/
define('AWS_KEY', '[アクセスキー ID]');
/**
* Amazon Web Services Secret Key. Found in the AWS Security Credentials. You can also pass this value as
* the second parameter to a service constructor.
*/
define('AWS_SECRET_KEY', '[シークレットアクセスキー]');
/**
* Amazon Account ID without dashes. Used for identification with Amazon EC2. Found in the AWS Security
* Credentials.
*/
define('AWS_ACCOUNT_ID', '[AWS アカウント ID]');
/**
* Your CanonicalUser ID. Used for setting access control settings in AmazonS3. Found in the AWS Security
* Credentials.
*/
define('AWS_CANONICAL_ID', '[標準ユーザーID]');
/**
* Your CanonicalUser DisplayName. Used for setting access control settings in AmazonS3. Found in the AWS
* Security Credentials (i.e. "Welcome, AWS_CANONICAL_NAME").
*/
define('AWS_CANONICAL_NAME', '[登録名]'); ※右上の、「ようこそ ~」の部分※以下は使ってないので未記入。
/**
* 12-digit serial number taken from the Gemalto device used for Multi-Factor Authentication. Ignore this
* if you're not using MFA.
*/
define('AWS_MFA_SERIAL', '');
/**
* Amazon CloudFront key-pair to use for signing private URLs. Found in the AWS Security Credentials. This
* can be set programmatically with .
*/
define('AWS_CLOUDFRONT_KEYPAIR_ID', '');
/**
* The contents of the *.pem private key that matches with the CloudFront key-pair ID. Found in the AWS
* Security Credentials. This can be set programmatically with .
*/
define('AWS_CLOUDFRONT_PRIVATE_KEY_PEM', '');
/**
* Set the value to true to enable autoloading for classes not prefixed with "Amazon" or "CF". If enabled,
* load `sdk.class.php` last to avoid clobbering any other autoloaders.
*/
define('AWS_ENABLE_EXTENSIONS', 'false');


これで準備オッケー。

おしまい。

0 件のコメント:

コメントを投稿