Amazon S3 on PHP
Prerequisites
You must have a valid Amazon Web Services.
You must be signed up to use Amazon S3.
Download the storage3 from http://blog.apokalyptik.com/storage3
Install these packages:
For gentoo: PEAR-Crypt_HMAC, PEAR-HTTP_Request
List Buckets
$keyId = "your AWS Access Key Id";
$secretKey = "your AWS Secret Access Key";
$s3 = new s3($keyId, $secretKey);
if($s3->listBuckets()){
$i=1;
foreach($s3->parsed_xml->Buckets->Bucket as $current){
print("$i. “.$current->Name.”
“);
$i++;
}
} else {
printError($s3->parsed_xml, $s3->responseCode);
}