The amazon php sdk is uploaded to site and the autoloader is included successfully. But I'm getting an error 500 with no further details. I believe I've isolated the issue to the instantiation of S3Client, as everything else works and if I comment out that it doens't give error 500. Code is as follows -

require $web_root.'/aws/aws-autoloader.php';

$keyname = "--keyname--";
$secret = "--secret key--";    

use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;

$s3 = new S3Client([
    'profile' => 'default',
    'region' => 'us-east-1',
    'version' => 'latest',
    'credentials' => [
        'key'    => $keyname,
        'secret' => $secret,

As found in the example php code here - https://docs.aws.amazon.com/AmazonS3/latest/dev/usingHLmpuPHP.html

Why is returning error 500?

  • If you use intentionally wrong credentials, does the HTTP response status code change?
    – user84582
    Commented Jun 1, 2018 at 7:05
  • same results as with correct credentials
    – omni
    Commented Jun 1, 2018 at 19:15

1 Answer 1


Try to put

use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;

Just after the require statement and at the top before any other PHP code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.