I spent the last few hours after tutorials on uploading files to Amazon S3 using php. I downloaded the latest version of the Donovan Schönknecht S3 class to my server (like S3.php), and I am trying to use the following code to test download capabilities. I know this code will work because I have seen many examples in action.
<?php require('S3.php'); $s3 = new S3('KEY', 'SECRET KEY'); //insert into s3 $new_name = time() . '.txt'; S3::putObject( 'upload-me.txt', 'bucketName', $new_name, S3::ACL_PUBLIC_READ, array(), array(), S3::STORAGE_CLASS_RRS ); ?>
When I try to load this page, a 500 server error occurs. In addition, every other authoritative textbook of this kind gave me the same 500 error.
I have confirmed that my key and secret key are valid by connecting to S3 using Cyberduck.
Does anyone know what I can do wrong?
Thanks,
Sean
source share