Uncaught exception ‘CFCredentials_Exception’ with message ‘No credentials were provided. [solved]

Uncaught exception ‘CFCredentials_Exception’ with message ‘No credentials were provided. [solved]If you’re using the Amazon Web Services (AWS) SDK (Software Developer Kit) version 1.5 “Allegro” for PHP you may have noticed an error like:

Fatal error: Uncaught exception 'CFCredentials_Exception' with message 'No credentials were provided. The SDK attempts to retrieve Instance Profile credentials from the EC2 Instance Metadata Service, but doing this requires the "default_cache_config" option to be set in the config.inc.php file or constructor. In order to cache the retrieved credentials.' in  #0 amazon-php-sdk/sdk-1.5.17.1/sdk.class.php:439

Stack trace:
amazon-php-sdk/sdk-1.5.17.1/services/ec2.class.php(155): CFRuntime->__construct(Array) #1 
amazon-php-sdk/sdk-1.5.17.1/_samples/cli-ec2_sorting_and_filtering.php(59): AmazonEC2->__construct() #2 {main} thrown in 
amazon-php-sdk/sdk-1.5.17.1/sdk.class.php on line 439

My solution was fairly simple – the PHP SDK download has a config-sample.inc.php file that you can copy to config.inc.php and then add your AWS key and secret key. After doing that you should be good to go.

Related Posts:

This entry was posted in Server Administration, Software, Tech Tips, Web Development and tagged , , , . Bookmark the permalink.

2 Responses to Uncaught exception ‘CFCredentials_Exception’ with message ‘No credentials were provided. [solved]

  1. Playforward says:

    This was really helpful.

    I was having this problem and the documents I had didn’t tell me I needed to change this file and enter my credentials.

    Thanks!

  2. Khalilrahman says:

    I like it

Leave a Reply

Your email address will not be published. Required fields are marked *