title: Amazon SDK for Php SNS Publish Error 500
body: <p>I am getting an error 500 when trying to do a SNS publish using the Amazon AWS SDK for PHP. If I run <code>PHP sendPush.php</code> in terminal it works perfectly fine but if I go to the URL in chrome I get an error 500.</p>
  
  <p>Here is my PHP file:</p>
  
  <pre><code>&lt;?php
  require 'vendor/autoload.php';
  use Aws\Credentials\CredentialProvider;
  use Aws\Sns\SnsClient;
  
  $arn = "&lt;my arn endpoint here&gt;";
  $message = 'test1';
  
  $provider = CredentialProvider::env();
  
  $client = SnsClient::factory(array(
      'profile' =&gt; 'default',
      'credentials' =&gt; $provider,
      'version'     =&gt; 'latest',
      'region'      =&gt; 'us-east-1'
  ));
  
  $message_atr =  array(
          'String' =&gt; array(
              'DataType' =&gt; 'String',
              'StringValue' =&gt; $message
          )
      );
  
  $publish_message = array('TargetArn' =&gt; $arn,'Message' =&gt; $message,'MessageAttributes'=&gt; $message_atr);
  
  $client-&gt;publish($publish_message);
  
  
  ?&gt;
  </code></pre>