title: DynamoDB Local Basic PHP Setup
body: <p>I am having some trouble connecting to my local instance of DynamoDB.  I am launching the server by running the following at the command prompt:</p>
  
  <pre><code>C:\Program Files\Java\jre8\bin&gt;java -Djava.library.path=D:\DynamoDB\DynamoDBLoca
  l_lib -jar D:\DynamoDB\DynamoDBLocal.jar
  </code></pre>
  
  <p>My PHP code looks like this:</p>
  
  <pre><code>&lt;?
  
  require './aws-autoloader.php';
  use \Aws\DynamoDb\DynamoDbClient;
  
  $client = \Aws\DynamoDb\DynamoDbClient::factory(array(
      'profile' =&gt; 'default',
      'region' =&gt; 'us-east-1',
      'base_url' =&gt; 'http://localhost:8000'
  ));
  
  
  // create test table    
  $client-&gt;createTable(array(
      'TableName' =&gt; 'errors',
      'AttributeDefinitions' =&gt; array(
          array(
              'AttributeName' =&gt; 'id',
              'AttributeType' =&gt; 'N'
          ),
          array(
              'AttributeName' =&gt; 'time',
              'AttributeType' =&gt; 'N'
          )
      ),
      'KeySchema' =&gt; array(
          array(
              'AttributeName' =&gt; 'id',
              'KeyType'       =&gt; 'HASH'
          ),
          array(
              'AttributeName' =&gt; 'time',
              'KeyType'       =&gt; 'RANGE'
          )
      ),
      'ProvisionedThroughput' =&gt; array(
          'ReadCapacityUnits'  =&gt; 10,
          'WriteCapacityUnits' =&gt; 20
      )
  ));
  </code></pre>
  
  <p>When I execute the createTable() command, I don't see any activity in my command prompt window where the server is running and I get the following error:</p>
  
  <pre><code>Fatal error:  Uncaught exception 'Aws\Common\Exception\InstanceProfileCredentialsException' with message 'Error retrieving credentials from the instance profile metadata server. When you are not running inside of Amazon EC2, you must provide your AWS access key ID and secret access key in the "key" and "secret" options when creating a client or provide an instantiated Aws\Common\Credentials\CredentialsInterface object. ([curl] 28: Connection timed out after 5008 milliseconds [url] http://169.254.169.254/latest/meta-data/iam/security-credentials/)' in C:\xampp\htdocs\AWS\Aws\Common\InstanceMetadata\InstanceMetadataClient.php:85 Stack trace:
  #0 C:\xampp\htdocs\AWS\Aws\Common\Credentials\RefreshableInstanceProfileCredentials.php(52): Aws\Common\InstanceMetadata\InstanceMetadataClient-&gt;getInstanceProfileCredentials()
  #1 C:\xampp\htdocs\AWS\Aws\Common\Credentials\AbstractRefreshableCredentials.php(54): Aws\Common\Credentials\RefreshableInstanceProfileCredentials-&gt;refresh()
  #2 C:\xampp\htdocs\AWS\Aws\Common\Signature\SignatureV4 in C:\xampp\htdocs\AWS\Aws\Common\InstanceMetadata\InstanceMetadataClient.php on line 85
  </code></pre>
  
  <p>I am a little confused because it seems like the code isn't hitting the local server what-so-ever which would obviously prevent anything else from working.  Any input/thoughts would be much appreciated.</p>