Sean Sean - 9 months ago 63
PHP Question

Using PHP to upload to Amazon S3

I've spent the last few hours following tutorials for implementing file uploads to Amazon S3 using php. I uploaded the most recent version of Donovan Schönknecht's S3 class to my server (as S3.php) and I am trying to use the following code to test upload capability. I know this code will work because I've seen numerous examples in action.



$s3 = new S3('KEY', 'SECRET KEY');

//insert into s3
$new_name = time() . '.txt';




I get an error 500 server error when I attempt to load this page. Additionally, every other reputable tutorial of this nature has given me the same error 500.

I verified that my key and secret key are valid by connecting to S3 with Cyberduck.

Does anyone have a clue as to what I could be doing incorrectly?



Answer Source

As it turns out, I was missing the cURL extension for PHP and this was causing an issue as the S3 class I was using required the use of cURL. All is working now.