title: Amazon S3 SDK PHP doesObjectExist() problems
body: <p>I've re-written this question to make it clearer, since I've updated it.</p>
  
  <p>I'm having trouble with the Amazon AWS S3 PHP SDK. I'm just trying to check if a file exists.
  Using this PHP script:</p>
  
  <pre><code>&lt;?php
      require_once("../../../configs/config.".get_current_user().".php");
      require INCLUDES_PATH . 'libraries/aws/aws-autoloader.php';
  
      use Aws\S3\S3Client;
  
      $client = S3Client::factory(array(
            'key' =&gt; AWS_ACCESS_KEY_ID,
            'secret' =&gt; AWS_SECRET_KEY
        ));
  
      $key = 'profile/avatar/80745d03-c295-4205-bd82-58161f2fd2d1-320.jpg';
      $result = $client-&gt;doesObjectExist( AWS_S3_BUCKET, $key );
  
      var_dump(AWS_S3_BUCKET);
      var_dump($key);
      var_dump($result);
  
  ?&gt;
  </code></pre>
  
  <p>This is the output:</p>
  
  <pre><code>string(19) "stage.socialite.app"
  string(59) "profile/avatar/80745d03-c295-4205-bd82-58161f2fd2d1-320.jpg"
  bool(false)
  </code></pre>
  
  <p>I know the file exists, it's here:</p>
  
  <p><a href="http://stage.socialite.app.s3.amazonaws.com/profile/avatar/80745d03-c295-4205-bd82-58161f2fd2d1-320.jpg">http://stage.socialite.app.s3.amazonaws.com/profile/avatar/80745d03-c295-4205-bd82-58161f2fd2d1-320.jpg</a></p>
  
  <p>This is the IAM policy for the user, whose Key ID and Secret Key I'm using:</p>
  
  <pre><code>{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Effect": "Allow",
        "Action": [
            "s3:*"
        ],
        "Resource": [
          "arn:aws:s3:::stage.socialite.app/*",
          "arn:aws:s3:::stage.socialite.app"
        ]
      }
    ]
  }
  </code></pre>
  
  <p>I've just created a new Key/Secret pair and added them to my config - what have I done wrong?</p>